Current time: 12-24-2024, 04:05 AM Hello There, Guest! (LoginRegister)


Post Reply 
Apache restart problem
Author Message
borzu Offline
Junior Member
*

Posts: 13
Joined: Jul 2010
Reputation: 0
Post: #1
Apache restart problem
Hi,
First off, thanks for the fantastic panel. I tried a couple of other free panels and none had such a well documentation and smooth installation procedure. Smile
However, unfortunately I could not get it up and running at the first strock. After installing ispCP Omega 1.0.5 (until step 3 here) on Debian lenny, I could not access admin.mysite.com page.

I figured out that apache daemon was not running and after trying to restart the process it I got this message:

Quote:Restarting web server: apache2WARNING: MaxClients (10) must be at least as large
as ThreadsPerChild (25). Automatically
increasing MaxClients to 25.
WARNING: MaxClients (10) must be at least as large
as ThreadsPerChild (25). Automatically
increasing MaxClients to 25.

This might also help to find out the reason: During the installation, while running 'make install', my 512Mb ram VPS ran out of memory and install failed, so, I stoped mysql and bind, and redone the step. then started the heavy procedures.

Here is my current 'top' procedures:

Quote:top - 00:31:15 up 1:06, 1 user, load average: 0.00, 0.00, 0.00
Tasks: 32 total, 1 running, 31 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 524288k total, 255808k used, 268480k free, 0k buffers
Swap: 0k total, 0k used, 0k free, 0k cached



PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1 root 18 0 1980 684 588 S 0 0.1 0:02.59 init
3306 root 18 0 9844 4092 2232 S 0 0.8 0:00.31 sshd
3354 root 15 0 2784 1452 1156 S 0 0.3 0:00.02 bash
23815 root 15 0 2256 956 792 R 0 0.2 0:00.03 top
34394 root 20 0 3764 1256 1068 S 0 0.2 0:00.00 mysqld_safe
34437 mysql 15 0 141m 17m 5068 S 0 3.4 0:00.18 mysqld
34441 root 18 0 2884 600 524 S 0 0.1 0:00.00 logger
44133 polw 16 0 7936 5428 1176 S 0 1.0 0:00.00 policyd-weight
44134 polw 18 0 7936 5172 920 S 0 1.0 0:00.00 policyd-weight
44451 postgrey 18 0 11368 7880 2440 S 0 1.5 0:00.00 postgrey
44606 root 25 0 2912 812 668 S 0 0.2 0:00.00 xinetd
48536 root 15 0 1692 596 488 S 0 0.1 0:00.01 syslogd
48583 root 18 0 5272 1020 668 S 0 0.2 0:00.00 sshd
48803 root 15 0 106m 940 708 S 0 0.2 0:00.09 nscd
49106 root 15 0 2036 684 548 S 0 0.1 0:00.00 cron
52346 root 23 0 1628 416 348 S 0 0.1 0:00.00 ispcp_daemon
52392 bind 18 0 83348 13m 2608 S 0 2.6 0:00.03 named
52535 nobody 18 0 9304 1788 632 S 0 0.3 0:00.00 proftpd
52834 root 15 0 6040 1800 1464 S 0 0.3 0:00.00 master
52836 postfix 15 0 5840 1820 1492 S 0 0.3 0:00.00 qmgr
52837 postfix 15 0 5796 1728 1404 S 0 0.3 0:00.00 pickup
53208 root 17 0 1832 424 344 S 0 0.1 0:00.00 courierlogger
53209 root 18 0 2048 656 528 S 0 0.1 0:00.00 authdaemond
53210 root 18 0 2048 256 128 S 0 0.0 0:00.00 authdaemond
53211 root 18 0 2048 256 128 S 0 0.0 0:00.00 authdaemond
53212 root 18 0 2048 256 128 S 0 0.0 0:00.00 authdaemond
53213 root 18 0 2048 256 128 S 0 0.0 0:00.00 authdaemond
53214 root 18 0 2048 256 128 S 0 0.0 0:00.00 authdaemond
54652 root 25 0 1832 348 276 S 0 0.1 0:00.00 courierlogger
54653 root 18 0 2104 456 376 S 0 0.1 0:00.00 couriertcpd
55000 root 22 0 1832 348 276 S 0 0.1 0:00.00 courierlogger
55001 root 18 0 2104 456 376 S 0 0.1 0:00.00 couriertcpd

I appreciate if you could tell me how to resolve the issue.
(This post was last modified: 07-20-2010 02:41 AM by borzu.)
07-19-2010 09:22 AM
Find all posts by this user Quote this message in a reply
pulponair Offline
Junior Member
*

Posts: 10
Joined: Jun 2010
Reputation: 0
Post: #2
RE: Apache restart problem
Hi,

first of all you should set the apache process settings to proper values (see warnings).
For a 512MB machine i would start with something like this: (assuming you are using the mpm-worker):
---
StartServers 2
MaxClients 150
MinSpareThreads 15
MaxSpareThreads 30
ThreadsPerChild 15
MaxRequestsPerChild 0

ThreadStackSize 4000000
---
Cheers,

Nikolas
07-21-2010 06:35 PM
Find all posts by this user Quote this message in a reply
borzu Offline
Junior Member
*

Posts: 13
Joined: Jul 2010
Reputation: 0
Post: #3
RE: Apache restart problem
Thanks Nikolas,
Actually first I needed to install apache2-mpm-prefork, as apparently it was not included in ispcp default set up. I applied your suggested settings and now my sandbox vps works fine on about 360 MB memory in contrast to previous 500+MB. Also the restart problem and the 500 error are gone.

I am totally noob in apache stuff, used to use nginx (I am loving it Smile . Have you any suggestion to know about apache configuration and optimisation? This giant should somehow be squeezed!

I am also a bit put off about the amount of memory that ispcp-apache-lo demon consumes. (currently 3 processes each 1.8%MEM) is there some way to ispcp footprint?
07-22-2010 11:17 AM
Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #4
RE: Apache restart problem
Quote:Actually first I needed to install apache2-mpm-prefork, as apparently it was not included in ispcp default set up. I applied your suggested settings and now my sandbox vps works fine on about 360 MB memory in contrast to previous 500+MB. Also the restart problem and the 500 error are gone.

You can take a look at the running ispcp on a low resources server "howto" (and contribute to it Tongue).

Quote:I am totally noob in apache stuff, used to use nginx (I am loving it Smile . Have you any suggestion to know about apache configuration and optimisation? This giant should somehow be squeezed!

Basically proper tunning of the worker and removing any unneeded modules. There's not much more to do in this war...

Quote:I am also a bit put off about the amount of memory that ispcp-apache-lo demon consumes. (currently 3 processes each 1.8%MEM) is there some way to ispcp footprint?
First of all, you should only have two ispcp-apache-logger instances. Their task is to separate the access and error logs from apache into domain-based files. If you are not going to host a big number of websites (<50), then it is possible to remove them, but it's a bit difficult. Hence, I'll throw the basic ideas over the table and let you work it by yourself if you want Tongue

- You can tell apache to create custom logfiles for each of your virtualhosts
- Nevertheless, if you do it and have a lot of virtualhosts, apache reaches the maximum number of open files and terrible things happen.
- Hence, the ispcp team created custom daemons that receive the log lines for all virtualhosts and write the appropiate per-virtualhost files.
- But this wasn't done until the first release candidates

Therefore, it should be possible to:

1. Disable global logging to the ispcp-apache-logger instances (they use piped logs, so just by commenting the definitions in the apache config and restarting these processes will never get launched again.)
2. Modify the virtualhost templates to tell apache to create the per-virtualhost logs themselve. Look for the proper directives in an oooooold ispcp release templates'.
07-22-2010 04:16 PM
Visit this user's website Find all posts by this user Quote this message in a reply
pulponair Offline
Junior Member
*

Posts: 10
Joined: Jun 2010
Reputation: 0
Post: #5
RE: Apache restart problem
(07-22-2010 11:17 AM)borzu Wrote:  Thanks Nikolas,
Actually first I needed to install apache2-mpm-prefork

Well actually my settings were related to the apach2-mpm-worker. I'd suggest to use the worker instead of the prefork mpm.

Ich you wan't to free some more memory you could safely reduce the
ThreadStackSize to 1mb or even 512kb. According to my pmap findings an avarange Apache thread uses arround 90kb of stack space.

BTW: i recently found this nice little script somewhere on the we and adapted it to fit my needs. Perphaps it helps you tracing memory usage:

http://bin.cakephp.org/view/1742357609

Sample output:
./avg_memory_usage.php apache2
14 "apache2" processes running allocating 327300.00 kb of private memory
Average process private memory allocation: 23378.57 kb

Cheers,
Nikolas
(This post was last modified: 07-22-2010 05:44 PM by pulponair.)
07-22-2010 05:27 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)