?
Solved

Magento & Apache optimization

Posted on 2010-11-19
3
Medium Priority
?
1,727 Views
Last Modified: 2012-05-10
Hi all,

I've a a linux Centos box with 8G B RAM & 1CPU  X3220 2.40GHz. Of these 8GB, 7GB is for the system and applications, and 1GB for the TMPFS.

It can be seen that the system is swapping. What should I do to prevent this?. Furthermore, I see apache it's consuming lots of memory, What should I do to prevent this?.

Top:
top - 02:55:32 up 4 days, 12:12,  2 users,  load average: 0.13, 0.24, 0.36
Tasks: 118 total,   1 running, 117 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.9%us,  0.1%sy,  0.0%ni, 98.8%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   8177616k total,  7063824k used,  1113792k free,   255480k buffers
Swap:  6289320k total,    44728k used,  6244592k free,  5614920k cached

httpd.conf:

Timeout 30
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 2

# prefork MPM
<IfModule prefork.c>
    StartServers          5
    MinSpareServers       5
    MaxSpareServers      20
    ServerLimit         450
    MaxClients          450
    MaxRequestsPerChild   0
</IfModule>

# worker MPM
<IfModule worker.c>
    StartServers          2
    MaxClients           250
    MinSpareThreads      25
    MaxSpareThreads      75
    ThreadsPerChild      25
    ServerLimit          25
    MaxRequestsPerChild  25
</IfModule>

 Apache/2.2.3
  Compiled in modules:
  core.c
  prefork.c
  http_core.c
  mod_so.c

What directive has more weight in terms of memory?

Thanks in advance
0
Comment
Question by:VMWARE
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 19

Accepted Solution

by:
Gabriel Orozco earned 2000 total points
ID: 34182015
What I see is you have a lot of memory free:
Mem:   8177616k total,  7063824k used,  1113792k free,   255480k buffers
Swap:  6289320k total,    44728k used,  6244592k free,  5614920k cached

This is
1,113,792k free
   255,480k buffers
5,614,920k cached
----------------------------
6,984,192k free

Since you have 7,063,824k used this means you have lots of memory still there to be used.

You see apache using lots of memory? I would only believe that in the case you where using a java app or some other kind of server side app.

To see which processess are using swap, you can open the top program, the type the capital 'O' and after that the letter 'p'.

You will see now processes ordered by their swap usage. start minvestigating from there.
0
 
LVL 19

Expert Comment

by:Gabriel Orozco
ID: 34182018
0
 

Author Comment

by:VMWARE
ID: 34186829
Hello Redimido,

I'm using PHP.

The output of top processes ordered by their swap usage

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  SWAP COMMAND
 2618 mysql     15   0 1074m 288m 6836 S 74.2  3.6   5140:27 786m mysqld
 6005 apache    15   0  373m 8816 1480 S  0.0  0.1   0:00.00 365m httpd
 5995 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 5996 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 5997 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 5999 apache    15   0  373m 8820 1480 S  0.0  0.1   0:00.00 365m httpd
 6004 apache    15   0  373m 8828 1488 S  0.0  0.1   0:00.00 365m httpd
 6007 apache    15   0  373m 8832 1492 S  0.0  0.1   0:00.00 365m httpd
.
.
.
If I have so much free memory, why it's swapping?
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
How important is it to take extra precautions to protect your online business? These are some steps you can take to make sure you're free of any cyber crime.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question