Mod_fcgid: Can't Apply Process Slot For Error?

Mar 9, 2011

update: Just looked at the cache update times of long queries and they did not collide with server crash time. update2: Found the cause of the problem. Ad server is down and the server hangs even though it seemswe set socket timeouts properly. Is there any way to test timeout behaviour?We have a very busy server. ~3K concurrent connectionshe server has 32GB ram 2xCPUs. We have service unavailable error issues.The server does not respond with 500 error and the error log shows hundreds/thousands of lines:

[warn] mod_fcgid: can't apply process slot for /var/www/fcgi-bin.d/php5-default/php-fcgi-wrapper

We think it can be a configuration error or a database connection/query errorA php process updates a cache which is a very very complex query result. 3 separate queries run each twice a day. I have enabled the slow query log. I suspect if the query exceeds the php run time limit 20 secs in our case (set in the following files).


View 2 Replies


Can't Apply Process Slot / [Tue May 03 15:44:47 2011] [warn] (104)Connection Reset By Peer: Mod_fcgid: Read Data From Fastcgi Server Error?

I've got a problem with a webserver. I did change nothing on the Apache config, I was just working on the site (typo3 FYI) when I got these 500 Error codes. Other websites are running fine. Could it be that it was a one-time error and apache then decided "I dont like you anymore"?

[Tue May 03 15:44:47 2011] [warn] (104)Connection reset by peer: mod_fcgid: read data from fastcgi server error.
[Tue May 03 16:00:02 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/typo3/ajax.php
[Tue May 03 16:00:08 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:00:38 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:00:42 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
[Tue May 03 16:01:00 2011] [warn] mod_fcgid: can't apply process slot for /home/<customer>/public_html/index.php
and so on...

my fcgid.conf

<IfModule mod_fcgid.c>
MaxProcessCount 100
AddHandler fcgid-script .fcgi
IPCConnectTimeout 20

would restart the (production-)server solve the problem?

View 2 Replies

Won't Process ELSE Even When IF Doesn't Apply?

Basically i have a simple login system that just uses sessions, but the code that I have used on certain pages (so that only a logged in member can access the page) doesn't seem to be working properly. Here is the code:

if (isset($_SESSION['myusername'])){
echo ("boo!");

View 4 Replies

Connection Reset By Peer: Mod_fcgid?

When I try to run a program in PHP using domPHP API to create PDF files in runtime - with Godaddy server, I am getting the message - Connection Reset by peer: mod_fcgid

the same work in our local server as well as in Dreamhost and Host gator.

Godaddy support insists that this is a coding error and not server issue.

View 1 Replies

Apache2 - Mod_fcgid With Opcode Caching?

I have been using apache web server with mpm-worker and mod_fcgid. I have read about mod_fcgid that it can not make use of opcode caching.[URL]....apc cache module seems to be enabled in my php configuration. I am not sure if my spawned php codes are never shared.

View 2 Replies

Apache2 - Sleeping Processes (mod_fcgid) Counsuming RAM Rapidly?

We are running a Debian (virtualized) server with Apache running php as fcgi. Today the administrator told me that the processes are consuming the RAM on the system. He asked me to look around my code. Well I think that virtually I have no control over the php processes since Apache spawns them, so this seems more like a server configuration problem. It seems that every request spawns a new php process (this is ok). After my script terminates the php process goes to sleep.

This is what top looks like. I sorted by memory and these are the php processes (they run on the user edem):

top - 14:49:35 up 41 days, 2:09, 2 users, load average: 0.16, 0.13, 0.06
Tasks: 228 total, 1 running, 227 sleeping, 0 stopped, 0 zombie
Cpu(s): 0.7%us, 0.3%sy, 0.0%ni, 98.7%id, 0.0%wa, 0.0%hi, 0.3%si, 0.0%st


how to kill those sleeping (idling) php processes? Is there something I'm doing wrong?

View 1 Replies

Slot Booking Mechanism?

I am making a doctor appointment slot booking mechanism,where in doctor appointment slots will be divided into 30 mins slot each...i have achieved all the working code.. 1 problem i am facing is that..this booking is made at 2 places i.e 2 when 1 selects a slot(radio button) not yet confirmed and saved in DB.

View 1 Replies

Date - Find Next Available Time Slot

Person A wants an appointment and the available time slots everyday is 9am, 12pm, 4pm, 6pm, 9pm. So, I need to check existing data and compare the time slots booked for the other appointments and then find next available.

$apts = array(
'Person 1' => '1/1/09-9:00',
'Person 2' => '1/1/09-12:00',
'Person 3' => '1/1/09-18:00',
'Person 4' => '1/1/09-21:00'

So, I need to find next time slot for Person A against $apts, and it should come up with 4pm (1/1/09-16:00). Then comes along Person B and the next time slot for him/her should be '1/2/09-9:00', since no more time slots on 1/1/09, so go to 9am next day.

View 1 Replies

Make Simple Slot Machine With Realistic Probability

I was just trying to make a simple php slot machine with realistic probability and was wondering whether anyone would have an idea of how to do that? The slot machine has 3 reels. I've started a function which produces the reels and has the option to select from '7', 'bar', 'orange', 'cherry', 'MISS (spun between 7 and cherry)' and 'MISS (spun between cherry and orange)'. If anyone can direct me on how to weight this probability to make the outcomes such as 7 and bar appear less often

View 3 Replies

Prevent A Time Slot And Seat Number Being Double Booked?

I have a problem trying to prevent a time slot and seat number being double booked. I am using PHP and MySQL for this. Currently I have no errors concerning variable names or issues with inserting data into the database. The only problem I seem to have involves preventing a certain seat number and time from being double booked. I have tried numerous things and I think the problem lies within my 'if' statement so i have shown a snippet of this below:

$sql="SELECT * FROM swinging_ship WHERE Time='$time' AND SeatNumber='$seatnumber'";
$sqlresult=mysql_query($sql) or die("Could not retreive data from table");
if ($row['Time']=='$time' AND $row['SeatNumber']=='$seatnumber')


Like I said all my variable names and SQL commands are working and the data is being inserted into the correct database tables and fields. The only problem is preventing the time and seat number from being double booked.

View 1 Replies

Slot Machine - Make The Page Add / Subtract Money Back Accordingly?

I'm making a harry potter-themed slot machine, and I can't figure out how to get bets to work. I can make the radio buttons...but how do I make a bank of money to have, and how do I make the page add/subtract money from this back accordingly?

<form method="post" action="slotmachine.php">
<p>Place Your Bets!
<input type="radio" name="wager" value="10" /> $10
<input type="radio" name="wager" value="20" /> $20
<input type="radio" name="wager" value="30" /> $30

View 1 Replies

Error Running Exec() To Kill A Process

Red Hat Linux 7.3, Apache 1.3, PHP 4.3.3 I am trying to create a PHP script to terminate a process that is running on the server. The file and folder permissions are set correctly, but I am getting the error "kill 943: Operation not permitted"; I am running the command "exec ("/bin/kill 943");".

View 4 Replies

Exec - Catch Background Process Error ?

How can I catch a background process error in PHP? I am running some commands to convert a PDF but sometimes the process gets killed. Is there anyway to monitor if the process has been completed successful ?

View 3 Replies

Exception Handling - Standardise Error Reporting Process

I work on a site with a large code base, for which which have our own error handling classes. We've decided to start using php5's exception handling mechanisms but as i look into it, i wonder when this is the right thing to do.

We want to use it to standardise our error reporting process, and to make sure failed bd queries are logged. As i've started though i've realised...

If i throw an exception in the DB class, and make the code using the class responsible for trying and catching, it means we'll have to go through the whole of our site adding try/catch blocks wherever we try and access the db. If we miss one, and at some point throw an exception, we'll get a fatal error which is the worst scenario. Alternatively we could make the DB class responsible for handling the whole situation as follows. Code:

View 3 Replies

Process A Bounce Email To Find The Error Code?

I've got a mass of 3000+ emails. I need to load up each one into a string (I can do that) and then run them through something, some code or some processing thing that will output the smtp error code of the reason why that email was returned.

Are there any websites that already do this online? Does anyone have an algorithm or some advice I can use to do this?

View 1 Replies

Could Not Start MySQL Service On Local Computer. Error 1067: The Process Terminated Unexpectedly .

Im getting this problem when i try to start mysql server when i try to right click and select 'start the service'...the lights

still red...i try to went MyComputer>Manage>Services and Applications>Services

i try to start mysql on properties...prompt error came out and says "Could not start MySQL service on local computer. Error 1067: The process terminated unexpectedly" .

View 2 Replies

Create A Script That Will Create A Form Dynamically Then Slot It Into An Html Template

I am trying to create a script that will create a form dynamically then slot it into an html template where it says {SHOWFORM} the trouble is as with a simple string replace its great for using allready output code however this will call the template find the tag then replace it with the form.Each template will be unique so it will be in a different place each time is there any easy way or shall i just bung it in a function and try the string replace thing?

View 1 Replies

Decide If A Failed System Process Like A Database Query Or Automated Email Merits An Error Message To The User?

I'm thinking through all the points in my PHP application where it performs some sort of system process like database queries, or sending out an email, and I'm wondering if at all these points I should be notifying a user when something goes wrong. There are so many points where an application can fall apart, that I'm having trouble determining if it is worth it to notify the user. Is it better to have some sort of logging in place, where every few days I just monitor the logs? Is there a standard approach for large-scale applications?

View 3 Replies

Start Process In Background Then Kill Process?

start a process from php in the background so I can kill it later in the script. Right now, I'm using: shell_exec($Command); The problem with this is it waits for the program to close. I want something that will have the same effect as nohup when I execute the shell command. This will allow me to run the process in the background, so that later in the script it can be closed. I need to close it because this script will run on a regular basis and the program can't be open when this runs. I've thought of generating a .bat file to run the command in the background, but even then, how do I kill the process later?

The code I've seen for linux is:

$PID = shell_exec("nohup $Command > /dev/null & echo $!");
// Later on to kill it
exec("kill -KILL $PID");

View 2 Replies

Multithreading - Process Forking And Get The Child Process Id

Objective: My script will download a remote file upon form submission, since the file might be big, I would like to fork off a process and let the user go on with his/her life.

Example of a command:

wget -q --limit-rate=1k --tries=10 "" -O /web/assets/content/image/image_euv_press.jpg

Method tried:

pcntl forking,
$pid = pcntl_fork();
if ( $pid == -1 ) {
} else if ( $pid ) {


Question: the background process method works but it's not clean, is there a better way to fork off a process to download and get that wget command PID so I can kill it later?.

I have tried echoing $! after doing the exec just to get the PID but exec('echo $!') doesnt return anything, i think it's because every exec is a different "space"

I added '> /dev/null 2>/dev/null &' to the end of the command on my terminal it would return something like: [3] 30751, but through php exec, there is no way to capture that returned PID.

View 3 Replies

Unit Testing - Getting The Output Of A Child Process's "PHP Fatal Error"

I've already learned that you can't catch PHP Fatal Errors, and your script will terminate about as soon as it hits one. I'm running a large PHP test suite (not PHPUnit, but a custom solution) on a CI server, and want to have the test pass/failures to be reported in JUnit output format.

Since way too many things in PHP are "Fatal Errors", I don't want the Fatal Error to end my test run, so my solution was to use forking, something like this:

foreach($tests as $test) {
$pid = pcntl_fork();
if ($pid) {


My idea was to close the STDERR in the child and have it send it's standard error to a pipe that the parent can read and save the error data into the JUnit file, but now I don't know if that's possible. Can you change the file for STDERR? Basically, what I want to do is like popen but without the exec() step.

Can I get the output of a child process after it died of a PHP Fatal Error?

View 2 Replies

Case Statement - Redirect To "index.php?db-backup=error" If The Process Fails

I've got a function that backs up a MySQL DB but am struggling adding error messages. I've managed to redirect on success, but would like to redirect to "index.php?db-backup=error" if the process fails for some reason.

function backup_tables($dbhost,$dbuser,$dbpass,$dbname,$tables = '*')
if($tables == '*')

View 1 Replies

Driver: If KIll A Process Will It Also Kill SQL Server Process (query)?

I am using PHP SQL Server driver - is there a way to kill the last query sent by sqlsrv_query function?If not, if I kill the PHP process will it also kill the query in turn?

View 1 Replies

Can Apply Css Within Die()

I need to use my error message div within die()... but i dont know if I can do this.. Im not good with escaping with quatations for example, I got

die ("Your ip has been blocked. Time till unblock:".($current_time - $blocked_time));

I need to put a div in there for the error style:

die ("<div class='error'>Your ip has been blocked. Time till unblock:".($current_time - $blocked_time));</div>

But I know that will just cause a bunch of errors.

View 2 Replies

Apply Preg_match To Get The Value 31.09 Out

i have somethig like this in my buff:
<TD>Average Rate</TD><TD align="right">31.09</TD>

i want to apply preg_match to get the value 31.09 do it do it?

View 2 Replies

Apply InnoDB

I had found an application which need InnoDB,I am not sure what is it.However it doesn't support by PHP/MYSQL,I am using xampp as localhost.May somebody help me to work it out?

View 11 Replies

Copyrights 2005-15, All rights reserved