Hello Vincent, Steve, and Francois,
Great thanks for your reply. I truly appreciate it.
I also consulted the article that Vincent posted and that was quite helpful too.
There are currently 3 mysql users on my server website:
a) root (connects to 4 databases (site that receives 3000 users per day. It does not use pconnect)
b) frank (Connects to database of site that uses pconnect and receives 1200 users per day)
c) tester (Connects to sites in beta testing, none uses pconnect, total 1000 visitors per day)
I just again had to reboot my server (I have to do it every 12 hours because of this mysql running out of resources kind of thing. Before I rebooted this I ran top command in telnet and got
idle: 97.8%
Meaning, I believe, that server is using only 2.2% of its ability.
Also before I rebooted I looked at list of actib=ve MySQL processes. I got around 80 for user frank and none for others. A typical line would look like this:
2466 frank localhost myid250 Sleep 22933 NULL
2511 frank localhost myid250 Sleep 160393 NULL
2562 frank localhost myid250 Sleep 12704 NULL
3442 frank localhost myid250 Sleep 11846 NULL
3580 frank localhost myid250 Sleep 110370 NULL
3583 frank localhost myid250 Sleep 10365 NULL
3982 frank localhost myid250 Sleep 5800 NULL
3985 frank localhost myid250 Sleep 2337 NULL
Where number after SLEEP is some sort of time measurement.
So I guess the problem is with that particular user that uses permanent connections. And even though root user is far busier it is not impacting the server.
My httpd.conf has the following lines:
MaxKeepAliveRequests 100
KeepAliveTimeout 15
MinSpareServers 8
MaxSpareServers 20
StartServers 10
MaxClients 150
MaxRequestsPerChild 30000
My questions is this respect:
1) Do any of httpd.conf variables have any role to play in optimizing server? Do they impact MySQL ability to handle connections?
2) The 5MB per connection means that 256 MBs are not enough for the 100 connections has (You are stating that this much is needed for operating system and cache alone). So when you say, how many the server can handle, I guess you are relying on available RAM and so 500 connections would require more than 1GB of RAM.
2) You mentionned RAM requirements per persistent connection. Is it same for non persistent connections but just freed faster?
3) In case I take persistent connections out, does the 97.2% idle mean I can have hundreds of thousands of visitors per day with same 256 MB?It seems that 5000 visitors have only used 2.8% of resources.
4) Based on what you said in your article, it seems a bad idea to have multiple databases on our server. What we are doing is a network of sites, each has its own database, and all databases have same mysql user (root). All these sites (around 20) are planned to be on same server. We can however join all 20 databases together and create one mega database with around 200 tables! Then we only have to worry about one MySQL connection per user instead of multiple as user is moving around networks. Is this a recommended option you think? Or will we be shooting ourselves in the foot?
5) If there a difference on how many actual mysql users are accessing various databses? Meaning if we have 20 sites and 20 databases none uses persistent connections, is there any difference on how whether these 20 databases are connected via 4 (5 tables each) or 1 mysql users?
6) You mentionned that hardcore limit of mysql server is 1000 connections. How can this allow Yahoo! finance to use MySQL for their operations? I am sure they have tons more connections than just 1000. Does anyone have any explanation?
Again I thank you all for your help. God bless
Freddie