I have a highly customized wordpress theme running 2 amazon aws ec2 micro servers using a load balancer. I notice after i browse the site around for about 5 - 10 minutes(or say around 50 clicks) the memory of the servers reach full(~600mb) on each server.
apache 2 threads take up about 10mb each. This happens everytime i restart the server(which starts with around 450mb free and quickly fills up). Once it reaches it's peak, any new requests are handled really slow.
I have turned off swapping but have enabled memcache and apc opcode. I'm also using w3ctotal cache.
I'm not sure where the problem lies:
- Is it possible that there is a memory leak?
On my localhost testing, i never run out of memory or server never crashes.
- Is it likely some server setting in apache is wrong on mine?
- Combination of above two?
I'm not sure why the memory never falls down at all, shouldn't the thread handling a request release memory after the timeout period?
I know this is a lot of questions, but i'm really looking for any help on how to optimize the site better.
Thanks for any help!