Slow website access, high server load-Find a problem method

Source: Internet
Author: User

If in the future the alarm can not ping the website, or the server load is too high, there are several ways to find the reason:
1, check the access log to see if there are access exceptions, such as, filter IP, IP encapsulation

Cat my.xoyo.com | awk ' {print $} ' | sort | uniq–c | sort–n >/tmp/ip.txt
Netstat-ntu | awk ' {print $} ' | cut-d:-f1 | sort | uniq-c | sort–n

2, check whether the network card has a serious packet loss phenomenon, ifconfig to see if dropped or error is constantly increasing, to determine whether the NIC problems.
netstat-n | awk '/^tcp/{++s[$NF]} END {for (a in S) print A, s[a]} ' view the status of each phase of connection
syn_sent (Request connection) established (in communication) state is significantly more connected

Netstat-n | grep "established" |awk ' {print $} ' |sort |uniq-c|sort-nr
It is possible to exclude a Dos attack if the IP that is in this state is found to be native.

Ifconfig
check whether the dropped or error is increasing to determine if there is a problem with the NIC.

3, if the log always involves an item, see if there is a recent new activity or update to determine if there is a problem with the program code

4, the problem of the project to bind each of the relevant front-end machine, to see if access is normal, troubleshoot the server

5, see which programs or apps are taking up some of the high-load processes
Top
View system load and high resource-intensive processes
lsof–p PID Number
See which processes the PID is using

6, check the usage of main application port, such as PHP, whether it is occupied
lsof–i: Port

7, check the slow log of PHP, whether there is a program file timeout, frequent error
php-fpm.conf Opening a Php configuration file
Request_slow_log_timeout 10s
Set execution time-out

8, if the above find problems related to MySQL, see if MySQL maximum connection is too low
Show variables like ' max_connections ';

This article is from the "lake and Laughter" blog, reproduced please contact the author!

Slow website access, high server load-Find a problem method

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.