Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7537521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:52:27+00:00 2026-05-30T06:52:27+00:00

I have been having intermittent issues on some servers running Archlinux / php-fpm 5.3.9

  • 0

I have been having intermittent issues on some servers running Archlinux / php-fpm 5.3.9 in FastCGI on Cherokee 1.2.101. I am using a caching plugin that builds and serves static cache files using logic like:

$cache_file = md5($host . $uri) . '.cache';
if( file_exists($cache_file) ) {
  $cache_file_contents = file_get_contents($cache_file)
  exit( $cache_file_contents );
}
// else build/save the $cache_file

A few processes will end up in the slow log of php-fpm hanging on that exit() call. At that time the load spikes, 100% CPU usage goes (almost) entirely to the webserver and PHP pages start returning 500 – Internal Server errors. Sometimes the server recovers on it’s own, others I need to restart php-fpm and cherokee.

  • I have the FastCGI settings for PHP-FPM configured to do a

  • Even though this is a VPS I would tentatively rule out IO wait on the filesystem as the cache file should already be loaded. I have not been able to catch it in the act to test with vmstat

  • I have pm.max_requests set to 500 but wonder if the exit() call is interfering with the cycling of processes.

  • The php-fpm log shows a lot of WARNING: [pool www] seems busy (you may need to increase pm.start_servers, or pm.min/max_spare_servers). This seems to be a normal part of php-fpm regulating the number of child processes in the pool though

Any tips on troubleshooting would be appreciated. Here are 3 things I found that raised some red flags:

http://www.php.net/manual/en/function.exit.php#96930

https://serverfault.com/questions/84962/php-via-fastcgi-terminated-by-calling-exit#85008

Errors when calling exit() function for fastCGI?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T06:52:29+00:00Added an answer on May 30, 2026 at 6:52 am

    I ended up using the Pythonic Exception wrapping method cited in the comments at http://www.php.net/manual/en/function.exit.php

    In the main index.php

    class SystemExit extends Exception {}
    
    try{ 
        /* Resume loading web-app */
    }
    catch (SystemExit $e) {}
    

    In the Cache Logic from the Question, replacing exit( $cache_file_contents );

    while (@ob_end_flush());
    flush();
    echo $cache_file_contents;
    throw new SystemExit();
    

    This has alleviated the php-fpm slow logs that show hangs on that exit(). I’m not entirely convinced that it solved the underlying problem but it has cleaned up the log files.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been having some issues with LINQ-To-SQL around memory usage. I'm using it
I have been having some problems trying to get my PHP running. When I
I have been having some issues retrieving JSON data from a WCF service application
I have been having a few issues using the quadrature function in python 2.7
We have been having some debate this week at my company as to how
As many of you may already know I have been having issues with another
I have been having some trouble with reminders as of lately. I was wondering
I have been having some trouble reversing my vectors in my game when a
I have been having some trouble finding a good way to output just the
I have been having problems with this for some time now, and have come

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.