Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: First access is slow
PostPosted: Fri Jun 01, 2012 4:09 pm 
Offline
Junior Member

Joined: Wed Jan 27, 2010 1:48 pm
Posts: 22
Location: Las Vegas, NV
I have a Linode 512 that I use to run email and probably half a dozen Drupal sites. I got it all up and running by using Virtualmin. My sites all have very low pageviews. I problem I'm having is when you access a site for the first time they take a very long time. I'm talking seconds here. Can someone help?

Here is a link to my munin page
http://webmail.lvthunder.com/munin/loca ... index.html


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 4:39 pm 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Something is devouring your memory causing quite a lot of swapping. Check out individual processes with 'top' or 'ps aux'.


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 4:58 pm 
Offline
Junior Member

Joined: Wed Jan 27, 2010 1:48 pm
Posts: 22
Location: Las Vegas, NV
My problem is I don't know how much is too much. Here is the list as output from Virtualmin in a csv format.


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 5:36 pm 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Well, it's simple really. You just add up numbers until you hit memory maximum and then decide what goes out.

For example, you seem to have 13 PHP processes each 60-70MB large. That's more than 780MB. On a 512 node.

Granted, I'm not familiar with Virtualmin and I don't know what those numbers are, shared virtual or res.

You also seem to have both PHP-CGI and Apache processes take quite a lot of ram. How so? Using both mod_php and fastcgi? Anyway, for those process sizes you can really afford 3 or 4 of each, leaving room for other things.


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 6:27 pm 
Offline
Junior Member

Joined: Wed Jan 27, 2010 1:48 pm
Posts: 22
Location: Las Vegas, NV
I just looked at the configuration and it does look like for the older sites the option is set for Apache mod_php (run as Apache's user) and for the newer ones it is set for FCGId (run as virtual server owner). I had some problems getting this set up originally so I hired a guy to do it. So I'll go bug him and see if he can wrangle it back in.

I have a question though. Why don't these processes go away if they aren't being used. I know there are not that many people visiting my sites at any one time.


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 6:42 pm 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Because they're set to have minimum number of processes active at any time. Check StartServers, MinSpareServers and MaxClients for Apache. Don't know what you're using for PHP.


Top
   
 Post subject:
PostPosted: Fri Jun 01, 2012 6:55 pm 
Offline
Senior Member

Joined: Mon Dec 07, 2009 6:46 am
Posts: 331
Just looked at your CSV and Munin graphs again. The Apache processes all have same amount of RAM and Munin shows just one active really. Can you check with ps -TAfm if those are Apache threads (there'll be one master Apache process with PID)? Using worker_mpm with PHP in fastcgi?


Top
   
 Post subject: Re: First access is slow
PostPosted: Mon Jun 18, 2012 1:14 pm 
Offline
Newbie

Joined: Mon Jun 18, 2012 1:08 pm
Posts: 3
Website: http://vpskb.com
Location: http://vpskb.com
I'm experiencing the same: first bit takes about three seconds. Subsequent page loads (different domains/platforms on the same server) take 0.2 seconds. This makes me doubt the cache theory. I'm thinking along the lines of DNS, even though I have HostnameLookups set to Off.


Top
   
 Post subject: Re: First access is slow
PostPosted: Thu Jun 21, 2012 3:39 pm 
Offline
Newbie

Joined: Mon Jun 18, 2012 1:08 pm
Posts: 3
Website: http://vpskb.com
Location: http://vpskb.com
The following seemed to help, at least it did with swapping.

Code:
    StartServers       3
    MinSpareServers    3
    MaxSpareServers    3
    ServerLimit        50
    MaxClients         50
    MaxRequestsPerChild  1000


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group