?
Solved

Magento & Apache optimization

Posted on 2010-11-19
3
Medium Priority
?
1,749 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
  • 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

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Ranking ecommerce websites is a vital process. You need to have a strong SEO (Search Engine Optimization) strategy. If you don’t have one, you are losing out on brand impressions, clicks and sales. Check this guide on how to improve website traffic …
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
Suggested Courses
Course of the Month14 days, 20 hours left to enroll

840 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