Next | Making Programs Faster | 83 |
The primary problem was the sudden burst of requests all at once
3000 instances of the program would run in a few minutes
These 3000 instances all competed for the CPU and the database
The programmers tried to improve turnaround time this way:
FORK: {
if ( $pid = fork ) {
# exit parent
CORE::exit;
}
elsif ( defined $pid ) {
close(STDIN);
close(STDOUT);
close(STDERR);
open(STDOUT,">>/programs/cassens/DC/CO/eHub/FordXML.stdout");
open(STDERR,">>/programs/cassens/DC/CO/eHub/FordXML.stderr");
}
This allows the server to respond to the client immediately
The child process goes on to talk to the database
This made the problem worse, not better
6000 processes instead of 3000
Next | Copyright © 2003 M. J. Dominus |