473,324 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

timeouts

107 100+
Hi,

I have a weboage that connects to a remote mysql server. When our network experiencing alot traffic this connection often times out and stops the page loading.

As the data provided from the db is only a small part of the overall page, how might one go about scripting php to cope with the timeout and continue loading the rest of the page, rather than stopping everything loading just because of one timeout. I was also going to change the default timeout of php from 60 to 5 seconds, any problems with this?

Cheers

Andy
Feb 4 '08 #1
3 995
MarkoKlacar
296 Expert 100+
Hi,

Are you using Apache?
What makes it timeout?What are you loading?
Feb 4 '08 #2
theS70RM
107 100+
Hi,

Are you using Apache?
What makes it timeout?What are you loading?

Yes im using apache.

It loads a local intranet page, but also populates a div with recent forum posts from a forum server at another site. But when there is heavy traffic, the script to connect to mysql on the remote server times out, and the page is not loaded, just a timeout error is displayed.
....

Actually I just checked the code again (its not my code) and the function that does the connect uses die() .... so i guess what im looking for is for it to return a message saying "unable to load" or something rather than using die(). heres the code:


Expand|Select|Wrap|Line Numbers
  1.  
  2. $result = mysql_query($sql)
  3.     or die ("Can't execute query.<br />".$sql."<br>".mysql_error());
  4.  
  5. return $result;
  6.  
  7.  
  8.  
Feb 5 '08 #3
MarkoKlacar
296 Expert 100+
Ok, what I would try is to free upp some unused variables or arrays.
If that does not change anything there is a configuration file in your php filer (php.ini) where you can set the timeout in seconds, try to change it to a larger number.

The second one worked for me, give it a shot.

GL
Feb 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Christian Luszick | last post by:
hi, I am using output buffering with ob_start and a callback function, which replaces variables like "%var%" with the equivilants taken out of a mysql database. This works well! But I get...
2
by: p2esp | last post by:
Hello, I'm using the xmlrpclib module to contact an XMLRPC server that takes a long time to send results back. My client timeouts. The question is whether there is a way to have an xmlrpclib...
3
by: Fazer | last post by:
Hello, I was wondering what's the best way of setting timeouts when working with urllib2. Thanks,
4
by: Laphan | last post by:
Hi Guys I've been using text files for Tab-Delimited/ADO/ASP sites so that users can update and display their products lists through my system with relative ease. Only problem is that for the...
5
by: Jim in Arizona | last post by:
I'm doing a query on a webproxy log, which is a pretty large table. I'm only doing a query on a single days worth, but could be upwards of 250000 records. Originally I got a timeout error saying to...
5
by: wamatt | last post by:
Subject: SQL server job timeouts? We have a job that uses WinHTTP inside a stored procedure. We have another SP wrapper that runs this for a couple hundred records. When we add this as a job...
4
by: zmcelrath87 | last post by:
I am having a problem involving the scope of timeouts and intervals. Since timeouts and intervals execute in the global scope, dynamically generated local interval/timeout declarations do not work,...
2
by: mircu | last post by:
Hi, I need a quick solution to make my application behave correctly when one of these timeouts occurs. I have some logic in session_start but when the authentication cookie timeouts the user is...
2
by: Fraijo | last post by:
how can i disable session timeouts without affecting any program codings?
10
by: Zytan | last post by:
I have a TcpClient. I set the read/write timeouts at 1 minute (in milliseconds). I get a NetworkStream from it and confirm the timeouts still exist. I do a NetworkStream.Write() and then a...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.