Thursday, July 17, 2008

Do check the ticket templates



Load Issues..

MYSQL:

The server load had been high due to increased MySQL activity by one of the users database in the server. We have optimized the database and restarted the MySQL service.

The MySQL has been tweaked for excellent performance.

We have confirmed that all the services are running perfectly in the server. The server load has been brought to the normal level.

Swap memory :

The swap memory being used in the server is high.

This means that the physical memory on the server is not available. When the server uses the Swap or the Disk Memory, the processes slows down.

We would recommend upgrading the RAM in the server to at least 2GB, which will satisfy the current workload.

Monitor:

There was a heavy load on the server which contributed to the issues you had been facing. Currently the load is very stable and all services are up.

The server has remained stable. Have you noticed any issues on your end ? Please advise so that we can further trouble shoot any lasting problems.

We have confirmed that all the services are running perfectly in the server. The server load has been brought to the normal level.




Monitoring and reboot.

Monitoring :

Thank you for your patience. This is an update as we have continued to monitor the services on your server and all has remained calm and the load low.

Have you experienced any issues on your end in the past 10 hours? If so please let us know in detail what issues occurred and we can do our best to resolve them . We will await your reply.

As stated earlier, we have been monitoring the server very closely and there has not been any reported issues by any other clients and we are not seeing any issues at this time.

top - 07:44:42 up 29 days, 19:19, 2 users, load average: 3.65, 3.75, 3.49

If you notice any issues on your end, please let us know.

We have taken as much precaution as possible to minimize this downtime.

The server has remained stable. Have you noticed any issues on your end?

Please advise so that we can further trouble shoot any lasting problems. We will leave this ticket open to continue monitoring the sites.

Reboot:
We will continue to monitor the server for progress on this situation and if you notice any issues, please do not hesitate to let us know.

Just to update you, the server was rebooted about 10 minutes ago as there was a heavy load on there which contributed to the issues you had been facing. Currently the load is very stable and all services should resume very shortly:



Shared Server Restriction

------------------

We are really sorry to say that we cannot install “FFMPEG” in a shared server. The main concerns of shared servers are performance and security.

It is a resource intensive program which may lead to high server load and hence affect all accounts hosted in the server.

We are not forcing you with shared server rules. We are ensuring more security for the server. Kindly understand the situation regarding this matter.

In such cases, you need to move to a dedicated server or VPS. If you wish, we can forward your request to our sales department.

Thanks a lot for your patience.

Load hike in the server..


Server Load...

Sometimes, there may be more number of httpd connections to the server. If we increase Maxclients to more than 300, it won’t be able to withstand the high access.

This can be fixed by enabling Raise Hard Server Limit on easy apache.

In WHM , go to Software > Apache Update:
1. Profile: Previously Saved Config [Start customizing based on profile]
2. Apache Version: (your choice) [Next Step]
3. PHP Major Version: (your choices) [Next Step]
4. PHP Minor version: (your choices) [Next Step]
5. Short Options List: (your choices) [Exhaustive Options List]
6. Exhaustive Options list: [CHECK] Raise Hard Server Limit
7. Save and build

The above process can be done via SSH as well (using /scripts/easyapache) and finding similarly “Raise Hard Server Limit” in order to enable it and then recompile Apache.

When you choose “Raise Hard Server Limit” (via cPanel or SSH), cPanel patches /home/cpeasyapache/src/include/httpd.h (using /home/cpeasyapache/src/cppatch/raise_hard_server_limit.patch) in order to increase HARD_SERVER_LIMIT from 256 to 2048.



Follow these steps to control the load on the server..

1===========Cpu process==========
Check processes and find the process that take high cpu usage
=>nice top
=>top -c Shift+m
=>pstree -pua

then kill it IF ANY SUSPICIOUS PROCESS
=>killall -9
=>kill -9

2===========Semaphores checking==========
to show IPC
=>ipcs -s

for i in `ipcs -s | awk ‘{print $2}’`; do ipcrm -s $i; done use this script to remove all semaphores.

lsof -c httpd |grep cwd|grep home| awk ‘{print $9}’|cut -f3 -d\/|sort -n| uniq -c|sort -n

3.==========Exim ===================================
If again high load exim check for spaming
If there are too many exim it may due to spaming
*then enable Spam assasination
*Remove frozen mails from the queue,
*Check for exim connection using netstat

exim -bp |grep frozen |awk ‘{print $3}’ |xargs exim -Mrm

Remove all mails in the server.

Forceful delivery:

exim -qff -v

4. =============http connections=DOS==================
=>pidof httpd
also check whether ir is due to url calling::

watch using

watch “ls -ltr /usr/local/apache/domlogs | tail -20″
netstat -plan | grep :80 | awk ‘{print $5}’ | cut -d: -f 1 | sort | uniq -c | sort -n

netstat -anp |grep ‘tcp\|udp’ | awk ‘{print $5}’ | cut -d: -f1 | sort | uniq -c | sort -n

If there are too many http connections from any IP, you can block that IP.
If you want to block an IP use the syntax

=>iptables -I INPUT -s IP -j DROP
or
=>apf -d IP
this edits apf.conf
4.===============Mysql =================

The status of the processes and databases accessed can be found using:
=>mysqladmin processlist status

=>/etc/init.d/mysql restart

5.=========Also check these================
Free memory in server
free -m

No of domains hosted in server
=>cat /etc/userdomains |wc -l

No of processors:
=> cat /proc/cpuinfo |grep processor

=>dmesg |grep error
https://twiki.cern.ch/twiki/bin/view/FIOgroup/DiskPrbSata

=> /scripts/smartcheck

also check access to a particular domain

cd /usr/local/apache/domlogs
ls -alSh |more

tail -f /usr/local/apache/domainname
if it suspend it

Block an IP with Route command

To block an IP address in the server with ‘route’ command in the kernel routing table.

# route add IP_ADDRESS reject

To view the status :

# netstat -nr
# route -n

You can verify whether the ‘FLAG’ of the IP address is ‘!H’

To remove the block:

# route del IP_ADDRESS reject

You can also specify the IP ranges with corresponding Subnet Mask.

# route add -net IP_ADDRESS netmask 255.255.XXX.XXX reject

rsyn facts!!

What is Rsync?
rsync is a file transfer program for Unix systems. rsync uses the “rsync algorithm” which provides a very fast method for bringing remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand. Some features of rsync include

  1. Can update whole directory trees and filesystems
  2. Optionally preserves symbolic links, hard links, file ownership, permissions, devices and times
  3. Requires no special privileges to install
  4. Internal pipelining reduces latency for multiple files
  5. Can use rsh, ssh or direct sockets as the transport
  6. Supports anonymous rsync which is ideal for mirroring

The Basics

If you don’t already have it installed, get it done this way on Debian systems:

apt-get install rsync

On other Linux distributions you would use yum(Fedora/CentOS) or yast (SuSE) to install rsync.

The base requirement of the rsync system is that you install the rsync program on the source and destination hosts. The easiest way to transfer files is to use a remote shell account. To copy a group of files to your home directory on host, you can run this command:

rsync file1 file2 … host:

Rsync defaults to rsh as the remote shell and that is not secure. Instead you can have rsync use ssh by using the option –rsh or -e ssh option:

rsync -e ssh file1 file2 … host:destination_dir

Copying one folder to another:

rsync -r /home/lxpages/junk /home/backups/junk/

That will copy the folder with simple application, without that much are to preservation of permissions/owners/etc. To make exact
duplicates, we can add the -a switch.

rsync -av /home/lxpages/junk /home/backups/junk

The above retains ALL ownership/permission and rsync in verbose mode.

rsync -av --delete /var/www/junk /home/lxpages/junk

The –delete keeps destination folder identical to source by removing any files that don’t match src dir.

rsync -av --delete -e ssh
lxpages@remotehost.com:/home/lxpages/junk /home/lxpages/junk

Rsync everything from remote server and folder /home/lxpages/junk to local server and folder /home/lxpages/junk.

There are many more examples which I will include later parts. For now just remember that man page is your friend. Simply type ‘man rsync’ and read/view all the available options you can play around with.

References: http://samba.anu.edu.au/rsync/