Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Mon Jun 20, 2011 8:06 pm 
Offline
Senior Newbie

Joined: Thu Jun 16, 2011 8:42 pm
Posts: 5
Website: http://www.bkosborne.com
Fairly new to Linux. Have always worked on managed dedicated boxes with WHM or Plesk, but I decided to have a go at tackling things myself.

I'm running a small Drupal site that sees ~600 visitors a day. It seems my IO have been averaging at around 2-3k, but it spiked to 7k earlier today. I ran the cmd "free" and this is the output:

total used free shared buffers cached
Mem: 435296 429280 6016 0 15336 16980
-/+ buffers/cache: 396964 38332
Swap: 262140 156372 105768


So it seems that the system is always swapping. I run the cmd "top" but there is nothing using more than 1% of memory. When I load a page on the site, apache/httpd comes in and eats up about 7-11%. But how does that explain that I have virtually no free memory?

Here is my my.cnf file
Code:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0

# To allow mysqld to connect to a MySQL Cluster management daemon, uncomment
# these lines and adjust the connectstring as needed.
#ndbcluster
#ndb-connectstring="nodeid=4;host=localhost:1186"

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[ndbd]
# If you are running a MySQL Cluster storage daemon (ndbd) on this machine,
# adjust its connection to the management daemon here.
# Note: ndbd init script requires this to include nodeid!
connect-string="nodeid=2;host=localhost:1186"

[ndb_mgm]
# connection string for MySQL Cluster management tool
connect-string="host=localhost:1186"


I could copy php.ini but it is large. Mem limit is set to 128mb (drupal is a memory hog), but I don't see how that could be the issue?


Hope you have patience for someone trying to learn. Thank you.[/code]


Top
   
 Post subject:
PostPosted: Mon Jun 20, 2011 8:44 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
Code:
ps aux --sort -rss
will sort processes by ram usage.

What's your apache MaxClients value?

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Tue Jun 21, 2011 12:17 am 
Offline
Senior Member

Joined: Wed Mar 03, 2010 2:04 pm
Posts: 111
Are you running Ubuntu and saslauthd by any chance?


Top
   
 Post subject:
PostPosted: Tue Jun 21, 2011 9:16 pm 
Offline
Senior Newbie

Joined: Thu Jun 16, 2011 8:42 pm
Posts: 5
Website: http://www.bkosborne.com
I'm running CentOS

obs:

I went into httpd.conf and changed my prefork settings to this:

<IfModule prefork.c>
StartServers 2
MinSpareServers 2
MaxSpareServers 4
ServerLimit 13
MaxClients 13
MaxRequestsPerChild 4000
</IfModule>

My linode has 512MB RAM, and each apache process eats up ~30MB. So I figured 13 for max would be a good number. I also lowered the others to make more 'sense'. Not sure what ServerLimit is revelant to, but I set it to match MaxClients. I didn't touch max requests though.

There is also a similar set of settings that I did not modify:

<IfModule worker.c>
StartServers 2
MaxClients 150
MinSpareThreads 25
MaxSpareThreads 75
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>

How can I test to see if worker.c is being used instead?

Thank you!!!!


Top
   
 Post subject:
PostPosted: Wed Jun 22, 2011 1:13 am 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
bkosborne wrote:
How can I test to see if worker.c is being used instead?

Thank you!!!!


apache2 -l (or maybe it's httpd -l in centos?) will list compiled in modules, you'll see worker.c or prefork.c in that list.

apache2 -V is a similar list of compiled options, a little more verbose, in that one, look for the APACHE_MPM_DIR


Top
   
 Post subject:
PostPosted: Wed Jun 22, 2011 7:51 pm 
Offline
Senior Newbie

Joined: Thu Jun 16, 2011 8:42 pm
Posts: 5
Website: http://www.bkosborne.com
Cool, looks like it was compiled with prefork. I also noticed memory usage is way down and no thrashing at all since the change :)


Top
   
 Post subject:
PostPosted: Wed Jun 22, 2011 8:42 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
There you go problem solved, it's almost always max clients when someone chirps up about ram on a new lamp stack!

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


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


Who is online

Users browsing this forum: No registered users and 0 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