Linux command ---- analyze CPU bottlenecks to measure CPU performance indicators: 1. CPU usage; CPU running regular user processes CPU running nicedprocessCPU running real-time processes 2. CPU usage; for IO management: interrupt and driver for
Metrics to measure CPU performance:1, the user uses the CPU situation;CPU runs regular user processesCPU Running niced ProcessCPU running real-time process2, the system uses CPU condition;For I/O Management: interrupts and drivesFor memory
At present, there is a project on hand, which is to run a website on an embedded device with a linux system. The CPU of the device is in the RAM structure, with a single core and 1 GB. We set up Apache + Mysql + php in the system, and then write a
Now there is a project on hand that runs a website in an embedded device with a Linux system.
The CPU of the device is RAM structure, single core, 1GB.
We set up a apache+mysql+php in the system and then write a website that runs inside. It feels a
Metrics to measure CPU performance:1, the user uses the CPU situation;CPU runs regular user processesCPU Running niced ProcessCPU running real-time process2, the system uses CPU condition;For I/O Management: interrupts and drivesFor memory
Sometimes, a Linux server running Nginx, php-cgi (PHP-FPM) Web services suddenly has a system load that is viewed with the top command, with a lot of php-cgi process CPU usage approaching 100%. Later, I tracked and found that this kind of situation
Php code for obtaining CPU usage
Share a few php code to get the cpu usage in the current system. if you need it, give it a reference.In php, you can use getrusage () to obtain CPU usage. this method is only applicable to linux systems.
Recently used PHP to do a server load monitoring of small things, on the server using Workerman to open a WebSocket service, and then in the browser to connect to the service. The service reads the information about the host every 10 seconds and
First, process tracking
The code is as follows
Copy Code
# Top//Find process PID with high CPU usage# Strace-p PID//tracking process# LL/PROC/PID/FD//See which files the process is working on
There will be
Sometimes, the Linux server running Nginx, php-cgi (PHP-FPM) Web services, suddenly the system load up, use the top command to view, many php-cgi process CPU utilization is close to 100%. Later, I tracked the discovery that this kind of situation is
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.