Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sun Nov 10, 2013 12:31 pm 
Offline
Newbie

Joined: Sun Jul 14, 2013 12:41 pm
Posts: 4
WARNING: Newbie armed with a VPS

BACKDROP TO THE SITUATION:

Linode 1GB RAM using 256mb for Swap
40 GB storage
8 CPU (1x priority)
2 TB Transfer

Total: 49152 MB
Used: 24320 MB
Free: 24832 MB

Overall data storage as of this writing: 7% above used amount

Running 5 websites on Apache2

All sites run on Drupal 7 CMS w/ individual databases
2 Sites running Drupal Commerce, (1 as sandbox and 1 as a future production site)

Basic Setup:
PHP5/MySql/Apache2
NO incoming Email
Site can and does mail out scheduled database backups
All database tar.gz files are under 0.5 mb each

Site is updated/upgraded weekly
All Drupal modules and core are current

The server was setup step-for-step using the Linode Library setup instructions with the following exception made to MySql config file:

Max_Packet_Size = 100M instead of 1M (This was done just recently after encountering a MySql
error that after researching and gaining further understanding to the Drupal Commerce database query sizes, was necessary).

THE ISSUES LEADING TO THIS POST:

I began receiving alerts that my I/O rate was exceeding the thresholds defined in the settings of my Linode Dashboard. This did not initially alarm me because I was doing considerable development on the live sites in maintenance mode but I was doing a large amount of writing to the database and theme developing as well.

However, when I began getting heavily into the most recent site, (a Drupal Commerce site that utilizes many modules), I then started seeing the sight just bog down.

Not being a whiz at understanding the charts from Linode, I believe most looks well within range EXCEPT I am accessing Swap memory almost continuously when there is any activity on the server. I say "any" at this point because right now I don't think the server is getting 1000 visitors per month let alone at any given simultaneous point in recent time.


WHAT I BELIEVE TO BE A POTENTIAL PROBLEM WITH MY LINODE CONFIGURATION:

Excessive consuming of Swap Memory. As noted above, considering there is virtually no traffic coming to the sites and I am simply developing at this stage, I don't think the activity I am performing warrants this amount of Swap activity.

This morning I monitored the site with TOP and recorded results during idle time and during times when I was in site admin mode actively writing to the database and loading pages. However, as noted in the opening WARNING statement, I am highly UN-qualified to interpret the charts Linode provides. So my first and foremost question is:

Is there a problem? (SEE SCREENSHOTS BELOW of Linode charts and the TOP program results)- Issue resolved, Image references removed. Thanks for all replies and assistance.


Last edited by lukaswebs on Wed Nov 13, 2013 9:46 pm, edited 1 time in total.

Top
   
PostPosted: Sun Nov 10, 2013 10:43 pm 
Offline
Newbie

Joined: Sun Jul 14, 2013 12:41 pm
Posts: 4
Answered!! Added research directed me to investigate the CMS optimization process for my particular CMS, (Drupal in my case). Issue appears at this point to be primarily related incorrectly cache settings).


Top
   
PostPosted: Mon Nov 11, 2013 12:10 am 
Offline
Senior Member

Joined: Mon Oct 12, 2009 1:20 am
Posts: 50
Typically the rule of thumb is if you are swapping, you do not have enough memory.

Get more memory or make other adjustments to lower the memory usage if you continue to swap.


Top
   
PostPosted: Mon Nov 11, 2013 2:09 pm 
Offline
Senior Member

Joined: Fri Jan 09, 2009 5:32 pm
Posts: 634
Your MaxClients in apache is probably too high. Search this forum, there are a zillion posts about it


Top
   
PostPosted: Tue Nov 12, 2013 7:41 am 
Offline
Newbie

Joined: Sun Jul 14, 2013 12:41 pm
Posts: 4
glg wrote:
Your MaxClients in apache is probably too high. Search this forum, there are a zillion posts about it


Right now MaxClient = 30

arjones85 wrote:
Typically the rule of thumb is if you are swapping, you do not have enough memory.

Get more memory or make other adjustments to lower the memory usage if you continue to swap.


I agree and after some investigating it became obvious that MySql and Apache are the RAM consuming culprits:

Total used free shared buffers cached
mem 987 964 23 0 28 128
buffer/cache 807 179
swap 255 116 139



    lwebadmin@mail:~$ ps auxf | sort -nr -k 4 | head -5
    mysql 24087 0.0 9.8 1290472 99188 ? Ssl Nov09 1:24 /usr/sbin/mysqld
    www-data 25765 0.0 8.1 392684 82656 ? S 07:56 0:12 \_ /usr/sbin/apache2 -k start
    www-data 25803 0.0 5.8 368908 58780 ? S 08:19 0:08 \_ /usr/sbin/apache2 -k start
    www-data 25794 0.0 5.6 367356 57180 ? S 08:12 0:10 \_ /usr/sbin/apache2 -k start
    www-data 25804 0.0 5.5 367444 56000 ? S 08:19 0:10 \_ /usr/sbin/apache2 -k start

I am running independent Drupal instances and a couple sites have alot of modules enabled w/ many queries using Views module.

I believe the main issue there is the .htaccess files Drupal requires along with many from contributing modules. So in the end, I have many, many .htaccess files that Apache has to find and aggregate. Unless of course someone sees something I don't in the above mem usage.

I am now wondering if there is a global way in the vhost file to add a <Directive> to include a script or something that will find and store all .htaccess files so they don't have to be searched for?

Thanks for input.


Top
   
PostPosted: Wed Nov 13, 2013 6:24 am 
Offline
Junior Member

Joined: Fri Nov 01, 2013 8:16 am
Posts: 21
Website: http://purbeckpixels.com
Location: England
You might want to consider installing nginx as a reverse proxy - it helped reduce the memory usage of Apache on my Linode and made my sites quite a bit faster. I wrote about it here:

https://forum.linode.com/viewtopic.php?f=12&t=10568#p61207

It's pretty easy to do.


Top
   
PostPosted: Wed Nov 13, 2013 7:30 pm 
Offline
Newbie

Joined: Sun Jul 14, 2013 12:41 pm
Posts: 4
nicholasmark wrote:
You might want to consider installing nginx as a reverse proxy - it helped reduce the memory usage of Apache on my Linode and made my sites quite a bit faster. I wrote about it here:

https://forum.linode.com/viewtopic.php?f=12&t=10568#p61207

It's pretty easy to do.


Thanks, I will definitely investigate this. However, I think I am going open another thread that is more focused on apache memory usage. I am interested in posting some tests that I've run on Apache and MySql RAM usage and see how it may compare to other community members just to make sure I haven't missed something large in the optimization process.

Thanks,
Again


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


Who is online

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