Skip to content

Checking your reading list…

Retry verification

Stay curious. Build better.

Appearance

Choose how BestHub looks on this device.

Changes apply immediately.

Search articles

Open Discover with these filters

Suggested searches

Why Is My Server Overloaded? Diagnosing Nginx FastCGI Temp IO Bottleneck
Operations 3 min read

Why Is My Server Overloaded? Diagnosing Nginx FastCGI Temp IO Bottleneck

A sudden high‑load alert on a web server was traced to Nginx’s massive write operations on fastcgi_temp files, revealed through top, iotop, lsof, strace and iostat, and temporarily resolved by redirecting fastcgi_temp to memory.

Problem description A server suddenly triggered a high‑load alarm and the website became slow.

Analysis

(1) Using top showed the CPU iowait exceeding 70%, indicating an IO overload.

(2) iotop -o revealed that Nginx’s write IO was unusually high, and top displayed the Nginx process in state D, meaning it was stuck waiting for IO.

At this point it was clear that Nginx’s heavy write activity caused the load, but the exact files being written were unknown.

(3) The PID of an Nginx worker was obtained and lsof -p <pid> listed open files, showing many entries under fastcgi_temp/xxx besides system libraries and logs.

(4) strace -p <pid> traced the process and confirmed massive writes to a specific file descriptor, matching the files identified by lsof.

(5) iostat 1 displayed heavy write IO on the partition that holds fastcgi_temp, confirming the source of the load.

A hypothesis was that an external client was uploading large files to php‑fpm, but monitoring inbound traffic with EZHTTP showed only modest traffic.

Solution

Since the fastcgi_temp IO pressure could not be eliminated instantly, the temporary fix was to point fastcgi_temp to /dev/shm (memory), restart Nginx, and restore service. A longer‑term fix will require collaboration with developers to address the root cause.

--- Thanks to HaiLin, chief architect of a major e‑commerce site, for providing this case study.

About this article

For questions about attribution, corrections or content rights, please contactadmin@besthub.devand we will review it promptly.

Report an issue with this article
operationsnginxserver performanceIO bottleneckLinux troubleshootingfastcgi_temp

Reader feedback

Was this useful?

Useful0

Discussion 0

Questions, practical examples and thoughtful responses.

Open full discussion