It looks like you're new here. If you want to get involved, click one of these buttons!
Hello,
I have a Ramnode 512 MB server. I've set up CF image hosting script earlier today. Since then, the ram usage of Apache has been increasing slowly without anything done on the server. There are no traffic or anything. Now apache 2 is consuming 231 MB ram(increasing slowly) with 10 process running. Server's total ram usage is 273 MB.
Could you guys please suggest me some fix? I'm running Ubuntu 12.04 64 bit.
I don't know nothing about linux and networking :(
Comments
Debian 6 32 bits.
Check if it destroys the image variables.
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksYou can lsof -p your Apache process to find out which files it has open.
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksI had the same problem before and a quick fix to it was to run a bash script to reload Apache every 30 mins.
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksI ran this command and got this. I don't know what to pick from this
I don't know nothing about linux and networking :(
- Spam
- Abuse
- Troll
0 • Disagree Agree Thanks@chinmoy
lsof -p [YOUR-APACHE-PID-NUMBER-HERE]
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksThat's normal for apache. Try switching to nginx ;)
@KamalN7
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksGuys, this is by far the most used web server you're talking about!!! Saying that this is normal or you need to restart the service every x time, just doesn't make sense.
@chinmoy What php handler are you using? If you're using mod_php, try switching to suphp, fcgid or php-fpm
What is your configuration for keepalive, StartServers, MinSpareServers, MaxSpareServers in httpd.conf ?
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksI say --- try Nginx.
I've never liked configs for Apache and it by default it is ho-hum performance with higher than necessary RAM consumption.
@CVPS_Chris loves --> http://www.hawkhost.com/
- Spam
- Abuse
- Troll
0 • Disagree Agree Thankstry lowering the KeepAlive timeout, if you have it enabled. I had mine set to 30 and always saw high RAM usage, lowering it to 5-10 seconds reduced the usage drastically.
ExploreLinux.com - mojeda.com - Server Status
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksSeconded. While nginx or other webservers might be better, Apache -should- run fine with appropriate tweaks.
I run RamNode. I'll fix my sig links later.
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksJust turn down the number of worker processes it's spawning - 10 is excessive.
But I agree, NGINX is far superior. I haven't used apache in years.
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksThanks for the reply everyone. I tweaked Timeout, KeepAlive, MaxKeepAliveRequests and KeepAliveTimeout. Now apache is using only 35 MB ram with 5 processes. :)
I don't know nothing about linux and networking :(
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksIf you really want to be friendly to your server, put Nginx infront of Apache, and make sure that all your images are served by Nginx.
Nginx really excels at serving up static files with minimal memory overhead - Since that's the majority of traffic you'll be getting to your site it's well worth the few minutes it takes to set it up :)
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksThanks :) Is it possible to be done on a live site? Any recommended tutorials?
I don't know nothing about linux and networking :(
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksSure is! All it requires is a single change to the Apache config file (moving it off port 80), installing Nginx (apt-get/yum install nginx) and making them talk to each-other.
Here's a nice example tutorial to read through. Once you read through the config file, it does 'make sense', sort of.
Interestingly this is the preferred method for setting up websites for a number of places, including AppFog, although whenever possible I tend to stick to an nginx-only environment :P
- Spam
- Abuse
- Troll
0 • Disagree Agree ThanksWe had a similar issue to yours when we moved servers last year (8 GB RAM for an eCommerce website, and Apache would find ways to eat all RAM and swap available). When we looked into it further, we found modsecurity to be the culprit. Apparently, in some instances when using the default config and logging to file, memory leaks may occur. Not sure if this has been fixed, or even if this may be contributing to your issue, but I figured I'd toss it out there.
DevOp based out of Chicago.
- Spam
- Abuse
- Troll
0 • Disagree Agree Thanks