LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-07-2008, 10:06 AM   #1
mconnors
LQ Newbie
 
Registered: Sep 2003
Posts: 4

Rep: Reputation: 0
thoroughly confused


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.
 
Old 05-07-2008, 10:28 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
So you're running:

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.
 
Old 05-07-2008, 10:40 AM   #3
mconnors
LQ Newbie
 
Registered: Sep 2003
Posts: 4

Original Poster
Rep: Reputation: 0
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?
 
Old 05-07-2008, 12:07 PM   #4
SlowCoder
Senior Member
 
Registered: Oct 2004
Location: Southeast, U.S.A.
Distribution: Debian based
Posts: 1,250

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by mconnors View Post
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.

Last edited by SlowCoder; 05-07-2008 at 12:13 PM.
 
Old 05-07-2008, 01:44 PM   #5
comm
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
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
 
Old 05-07-2008, 04:03 PM   #6
seraphim172
Member
 
Registered: May 2008
Posts: 101

Rep: Reputation: 15
bug hunt

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...

Linux Archive

Last edited by seraphim172; 06-05-2008 at 10:43 AM.
 
Old 05-07-2008, 10:15 PM   #7
comm
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by seraphim172 View Post
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.
 
Old 05-08-2008, 12:27 AM   #8
nigelc
Member
 
Registered: Oct 2004
Location: Sydney, Australia
Distribution: Mageia 7
Posts: 406
Blog Entries: 4

Rep: Reputation: 80
Maybe the memory has a fault try memtest86 for a while.
It might pick up some errors.
 
Old 05-08-2008, 08:14 AM   #9
ajcoon
LQ Newbie
 
Registered: May 2008
Posts: 1

Rep: Reputation: 0
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.
 
Old 05-08-2008, 12:57 PM   #10
comm
LQ Newbie
 
Registered: May 2008
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by ajcoon View Post
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.

Last edited by comm; 05-08-2008 at 11:05 PM.
 
Old 05-09-2008, 02:18 PM   #11
ddenton
Member
 
Registered: May 2007
Posts: 114

Rep: Reputation: 15
Quote:
Originally Posted by ajcoon View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Confused nay Very Confused chrystlenight SUSE / openSUSE 3 08-28-2007 05:57 PM
Confused ben_elliott Linux - Newbie 5 11-13-2005 06:16 PM
Very confused... inspectreo Linux - Newbie 11 05-23-2005 11:30 AM
I am confused... odious1 Linux - Networking 3 11-01-2003 03:37 AM
Very confused... MoriyaMinakata Linux - Newbie 5 04-14-2003 09:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:45 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration