Welcome, Guest
Please Login or Register.
Lost Password?
Getting the most out of your server (1 viewing)
Post Reply

TOPIC: Getting the most out of your server

#15447
acid (User)
Posts: 16
graphgraph
Getting the most out of your server 2008/08/06 11:18  
For Centos 5.2 + Virtualmin Pro

If you have more than 400 accounts, you get more than 100K mails (60% spam) a day and more then 500 GB Bandwidth Usage (don't forget to make backups first):


1- In:

/etc/cron.hourly/00awstats

change this line:

if [ -f /var/log/httpd/access_log ] ; then

for

if [ -f /var/log/httpd/access_log_let_my_cpu_alone ] ; then


2- In: Webmin -> Webmin -> Webmin Configuration -> Advanced Options -> CPU priority for scheduled jobs, select Priority level = - 15


3- In: Virtualmin -> Email Messages -> Spam and Virus Scanning -> Enable ClamAV Server

Then go again to Virtualmin -> Email Messages -> Spam and Virus Scanning -> in SpamAssassin client program select: spamc -> in Maximum message size to process for spamc type: 1000000 -> in Virus scanning program select: Server scanner (clamdscan) -> and Save


4- In: Webmin -> System -> Bootup and Shutdown -> postfix -> Start at boot time? = No -> Save

DON'T FORGET to start postfix after booting!

We are doing this because if you are getting too much mails by starting the Server you will get out of memory (RAM and swap, if you are luky the kernel will stop postfix otherwise you will need to poweroff the server) (... too much lookup-domain processes will get started).


5- This point is only for experts! Don't do it if you don't know what are you doing! (don't forget to do backups)

Type:

ulimit -n

if you see 1024 you can increase this number by doing this:

- In /etc/security/limits.conf add this 2 lines:

* soft nofile 4096
* hard nofile 4096

- In /etc/pam.d/login add this line:

session required pam_limits.so

- In /etc/rc.d/rc.local add this line:

ulimit -n 4096

- reboot


6- Adding this line in /etc/httpd/conf.d/fcgid.conf

MaxRequestsPerProcess 500

You should stop getting this error in /var/log/http/error_log:

Too many open files: mod_fcgid: couldn't set child ...

Don't forget to restart your apache (/etc/init.d/httpd restart)

http://fastcgi.coremail.cn/doc.htm


-----------

Any more tips we will gratefull!! ;)

Post edited by: acid, at: 2008/08/07 07:12
  The administrator has disabled public write access.
#15450
Joe (Admin)
Posts: 3798
graph
Re:Getting the most out of your server 2008/08/06 12:28  
more than 400 accounts, you get more than 100K mails (60% spam) a day and more then 500 GB Bandwidth Usage (don't forget to make backups first)

Sweet! I love hearing about big deployments.

4- In: Webmin -> System -> Bootup and Shutdown -> postfix -> Start at boot time? = No -> Save

DON'T FORGET to start postfix after booting!

We are doing this because if you are getting too much mails by starting the Server you will get out of memory (RAM and swap, if you are luky the kernel will stop postfix otherwise you will need to poweroff the server) (... too much lookup-domain processes will get started).


This sounds like something we need to deal with. I'm not sure how, though...we've already daemonized lookup-domain to make it fast. But, an accidental "fork bomb" spawned by delivering hundreds of messages to procmail at once is harder to manage.
  The administrator has disabled public write access.
Post Reply
get the latest posts directly to your desktop

Talk and Get Help

Support
Forums
Bugs and Issues

Get Virtualmin

OS Support
Buy Online
Download
Copyright 2005-2007 Virtualmin, Inc. All rights reserved.