Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am renting a server for the past year from Hostway with plesk and I set up DNS server on it. But oom keeps taking down mysql because of memory problems. I upgraded memory to 2GB and it still happens. Rackaid tells me they will charge 125 per hour just to look at it. I asked hostway why this keeps happening and they say....
"If you are running many sites, it is quite common for apache & mysql to
run out of memory since they are quite the memory hog. I would recommended
you google for LAMP tunning tips to try and fine tune features of mysql
and apache that you might not need. If you feel your server would
bennefit from more ram, please contact your account manager to geta
price quote on this. "
I am running 3 sites and hardly anyone is on any of them. What a pile of steaming BS. Can anyone point me in the right direction? I am thinking I should just find another host.
DNS
Apache w/3 different websites
MySQL
Linux
Plesk
in 2 GB of RAM? Yes, I'd say you might have a small shortage of memory. Apache and MySQL do need to be tuned to play better together. There's lots you can do to optimize your memory usage. You don't say how big your database is, or what kind of pages you're hosting (i.e. PHP will also take a nice chunk), or if the pages are computationally intense (generating graphs on the fly, etc.).
Why not try to build a small Linux machine with comparable specs at your local site, and load up the same stuff, and see what kind of usage you get? You can play with the tuning parameters, and see what happens.
actually looking further there are 11 sites, but only 3 get traffic and this month is 300MB total. The databases are small, one is a gallery site. The other 2 are simple DBs with about 40 records between the both of them and the sites serve up portfolios. I guess I jumped to conclusions. I don't understand why hostway wouldn't tell me how much RAM I actually need. Shouldn't 2GBs be enough?
actually looking further there are 11 sites, but only 3 get traffic and this month is 300MB total. The databases are small, one is a gallery site. The other 2 are simple DBs with about 40 records between the both of them and the sites serve up portfolios. I guess I jumped to conclusions. I don't understand why hostway wouldn't tell me how much RAM I actually need. Shouldn't 2GBs be enough?
Can you post the output of "free" from that server?
I recommend that you:
- Turn off any unused services
- Go to text mode (usually runlevel 3) if you don't need to run X
- If you're still going deeply into your swap, get more RAM.
P.S. Please use more descriptive subjects in the future. "thoroughly confused" is not a good technical description for your RAM woes.
I registered just to post a reply to this question.
You have more than enough memory for your servers current tasks. If your server is running out of memory, then something is either breaking or something is being abused.
First you need to know why you're getting OOM's. Write a simple shell script, like the following:
#!/bin/sh
echo "###########`date`###########" >> /var/log/oom.log
# check process list
/bin/ps auxwwf >> /var/log/oom.log
# check memory
/usr/bin/free >> /var/log/oom.log
# might need to use --password="" if you don't have a /root/.my.cnf
/usr/bin/mysql -u root -e 'show processlist'
# check apache status, to enable http://httpd.apache.org/docs/2.2/mod/mod_status.html also enable ExtendedStatus On
/usr/bin/links -dump http://localhost/server-status
#check virtual memory and I/O activity
/usr/bin/vmstat 1 10 >> /var/log/oom.log
You can add more commands, but that should give you enough information on your system state. Put this into a cron job and have it run every 5 minutes or 10 minutes.
You should now know whats causing the issue. Post back the results so we can help you out.
Last edited by comm; 05-07-2008 at 01:45 PM.
Reason: grammar
RAM is not the problem. I have seen servers running Apache, MySQL and a lot of other services running on old PC's with much less then 1 GB of RAM.
I agree with comm that something is breaking or something is being abused. You should temporarily disable the sites (if possible) one by one, to see which one causes the problem. In the end even turn off the entire web server to make sure it's not related/caused by the web server.
RAM is not the problem. I have seen servers running Apache, MySQL and a lot of other services running on old PC's with much less then 1 GB of RAM.
I agree with comm that something is breaking or something is being abused. You should temporarily disable the sites (if possible) one by one, to see which one causes the problem. In the end even turn off the entire web server to make sure it's not related/caused by the web server.
This will be quite time consuming...
Indeed, 1G of ram can go a long way if you use it properly.
If you do the above steps I mentioned you'll know whats causing the issue, and I can guarantee that its a site on your server with a run away php application.
Ask to have the memory tested and/or replaced. Statistically speaking, a company the size of Hostway and the number of servers they build, there's going to be some bad memory occasionally. They should quickly replace it for you.
Also, you don't need to run all of those separate commands to see system resource usage details. sar (with a slew of options...RTFM) will tell you everything you need to know.
Ask to have the memory tested and/or replaced. Statistically speaking, a company the size of Hostway and the number of servers they build, there's going to be some bad memory occasionally. They should quickly replace it for you.
Also, you don't need to run all of those separate commands to see system resource usage details. sar (with a slew of options...RTFM) will tell you everything you need to know.
If you want to find out system resources currently being used then sar will work prefectly.
But he already knows that the server is running out of memory, he just needs to find out what is causing it. He's already mentioned what he uses his server for, the commands I provided will most likely point out or uncover the culprit.
Also, you don't need to run all of those separate commands to see system resource usage details. sar (with a slew of options...RTFM) will tell you everything you need to know.
If you're more keen on graphical representations to show what SAR would display for system usage, I'd look into KSAR. It's a java GUI app with a built-in SSH client that allows you to remotely generate mem, i/o, network, etc graphs over the course of a day. This might make it easier to see where the hang-ups are in your performance.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.