Fix Slow VPS with 256MB/ Apache memory issues

Fix Slow VPS with 256MB/ Apache memory issues

Cancelled

Job Description

I run wordpress sites on ubuntu server VPS from rackspace cloud.

They all have the same basic configuration:

256MB Ram
10GB Space

Ubuntu Server 12.04 LTS

zlib installed
zlib output compression off

MySQL
PHP Version: 5.3.10-1ubuntu3.4

Apache 2 + following mods
alias
auth_basic
auth_digest
authn_file
authz_default
authz_groupfile
authz_host
authz_user
autoindex
cache
cgi
deflate
dir
env
expires
mem_cache
mime
negotiation
php5
reqtimeout
rewrite
setenvif
status
mod_deflate
mod_env
mod_expires

In addition there are security/programs running that use up memory too:

fail2ban
logwatch
monit
denyhosts


Wordpress has a few plugins:
shopplugin.net
w3 total cache
contact form 7
simple sitemap
aksimet
AdRotate
Simple Sitemap

Typical usage:

up to 1000 visitors a day
22 connections (css, js, html, etc) per page on average
1.5MB per "product" page size when I measure the download average
Periodically I want to run a newsletter script that will burst memory/cpu usage, but this is a once a week event
All of this while running an ssh tunnel/socks proxy when editing the /wp-admin page


The problem is that no matter what I've tried so far, apache is taking up too much memory and eventually swap usage slows everything down too much (as reported by vmstat and free). I've tried other options like nginx/php op codes, but this only makes additional problems and is harder to troubleshoot. I want to stay with apache as my scripts work with it.

You won't get shell access, but we can do a screen share or you can suggest things for me to try. I want to keep server memory as low as possible while still being able to run wordpress, php, etc. The end goal is to have a fast site that fits in a 256MB VPS (238MB usable). I understand I will need to go to 512MB or higher at some point, but I want to make an intelligent move, and optimize the best I can while I scale, not simply throw more RAM at the problem especially for new sites that get very little traffic on the VPS.

I'm open to different payment options that work best for you (hourly, by the question, project etc). I have need for an ongoing linux expert that can help with issues like this in a timely manner.

Here is some relevant information from the apache.conf
Timeout 10
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 4

<IfModule mpm_prefork_module>
StartServers 2
MinSpareServers 2
MaxSpareServers 2
MaxClients 2
MaxRequestsPerChild 500
</IfModule>

<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 50
MaxRequestsPerChild 500
</IfModule>

<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 50
MaxRequestsPerChild 500
</IfModule>


my.cnf settings (some)
key_buffer = 16k
max_allowed_packet = 1M
thread_stack = 64K
thread_cache_size = 8
table_cache = 4
query_cache_limit = 1M
query_cache_size = 16M

skip-innodb

the benchmark i have will be http://www.webpagetest.org, which currently has most items loading very fast (100ms to 400ms), but then one of the css files (it's different each time, like it's a connection limit, not a specific file), will take 6s to 28s..

If you are able to assist with this and would like to apply, DO NOT send a generic cover letter that states "you understand my request and would like work". Instead please say something specific and intelligent that relates to information I've posted - so I know you've actually read this. Generic responses will be deleted.

I also expect no more than 24 hour responses, though you can take longer for an actual solution. Speed of communication is important and this can't drag on for weeks to find a solution. I use skype, gmail chat, or email.

Thank you and I look forward to working with you.

---
Skills: apache, linux, gmail

Open Attachment