473,396 Members | 2,061 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,396 software developers and data experts.

server response slowing down

Hi All,

I have a private website created using HTML/PHP. Within this site, there is
a page that has a form (question.php), which is populated depending on the
question number that has been posted to it.

When the form is submitted, the data is posted back to the same page
(question.php), and the code within the page saves the posted data, and
displays the next question, and so it goes on...

While the page loads almost instantly for the first 15 or so questions, the
server response gets gradually slower, to the point where the page takes
about 30 secs to start loading after about 18 questions.

I'm trying to understand what may be causing the lag... It doesn't seem to
be the loading of the page that's taking the time, it's the response time
from the server before the page starts loading that seems to increase.

The page does use MySQL tables, but all are well indexed, and as I say, you
can load the page about 15 times, before any noticeable delay starts to
happen.

Anyone any ideas please?

(I've put the complete site on 2 different servers - 1 on a shared hosting
account, and 1 on completely different managed server, and the same thing
happens on both servers!?).

Thanks,
Chris.


Aug 2 '06 #1
7 1701
Chris Thompson wrote:
Hi All,

I have a private website created using HTML/PHP. Within this site, there
is a page that has a form (question.php), which is populated depending on
the question number that has been posted to it.

When the form is submitted, the data is posted back to the same page
(question.php), and the code within the page saves the posted data, and
displays the next question, and so it goes on...

While the page loads almost instantly for the first 15 or so questions,
the server response gets gradually slower, to the point where the page
takes about 30 secs to start loading after about 18 questions.

I'm trying to understand what may be causing the lag... It doesn't seem
to be the loading of the page that's taking the time, it's the response
time from the server before the page starts loading that seems to
increase.

The page does use MySQL tables, but all are well indexed, and as I say,
you can load the page about 15 times, before any noticeable delay starts
to happen.

Anyone any ideas please?

(I've put the complete site on 2 different servers - 1 on a shared hosting
account, and 1 on completely different managed server, and the same thing
happens on both servers!?).

Thanks,
Chris.
Hi Chris,

That indicates that your script has a higher workload the higher the
questionnumber is.
That could indicate that the script is doing more work for question number
20 than for question number 1.

Do you only perform the quesries needed?
Are you maybe 'counting' by doing subsequent databasequeries untill you
pulled the 'right' question from the table(s)?

Regards,
Erwin Moller
Aug 2 '06 #2
Hi Erwin,

Thanks for this, but if I start at question 20, and navigate backwards to
question 1, it still starts to slow down at question 5, so doesn't seem to
be the answer...

Cheers anyway,
Chris.

"Erwin Moller"
<si******************************************@spam yourself.comwrote in
message news:44**********************@news.xs4all.nl...
Chris Thompson wrote:
>Hi All,

I have a private website created using HTML/PHP. Within this site, there
is a page that has a form (question.php), which is populated depending on
the question number that has been posted to it.

When the form is submitted, the data is posted back to the same page
(question.php), and the code within the page saves the posted data, and
displays the next question, and so it goes on...

While the page loads almost instantly for the first 15 or so questions,
the server response gets gradually slower, to the point where the page
takes about 30 secs to start loading after about 18 questions.

I'm trying to understand what may be causing the lag... It doesn't seem
to be the loading of the page that's taking the time, it's the response
time from the server before the page starts loading that seems to
increase.

The page does use MySQL tables, but all are well indexed, and as I say,
you can load the page about 15 times, before any noticeable delay starts
to happen.

Anyone any ideas please?

(I've put the complete site on 2 different servers - 1 on a shared
hosting
account, and 1 on completely different managed server, and the same thing
happens on both servers!?).

Thanks,
Chris.

Hi Chris,

That indicates that your script has a higher workload the higher the
questionnumber is.
That could indicate that the script is doing more work for question number
20 than for question number 1.

Do you only perform the quesries needed?
Are you maybe 'counting' by doing subsequent databasequeries untill you
pulled the 'right' question from the table(s)?

Regards,
Erwin Moller

Aug 2 '06 #3
Chris Thompson wrote:
Hi Erwin,

Thanks for this, but if I start at question 20, and navigate backwards to
question 1, it still starts to slow down at question 5, so doesn't seem to
be the answer...
If that is true depends on the (mistakes in) underlying code.

I think nobody can answer this question without more information/code.

I expect your code is somehow doing more and more work as it handles more
questions.
Why else show question 5 the first time be quick, and after 15 subsequent
question become slow?
It sounds like all old given answers are somehow reinserted each time or all
questions are re-queried, or something like that.

Show us some relevant code or describe in detail how your application is set
up.
I cannot think of any valid reason why the database or your script gets slow
if you design the application in a normal way. Must be some mistake
somewhere in the logic.

Regards,
Erwin Moller
>
Cheers anyway,
Chris.

"Erwin Moller"
<si******************************************@spam yourself.comwrote in
message news:44**********************@news.xs4all.nl...
>Chris Thompson wrote:
>>Hi All,

I have a private website created using HTML/PHP. Within this site,
there is a page that has a form (question.php), which is populated
depending on the question number that has been posted to it.

When the form is submitted, the data is posted back to the same page
(question.php), and the code within the page saves the posted data, and
displays the next question, and so it goes on...

While the page loads almost instantly for the first 15 or so questions,
the server response gets gradually slower, to the point where the page
takes about 30 secs to start loading after about 18 questions.

I'm trying to understand what may be causing the lag... It doesn't seem
to be the loading of the page that's taking the time, it's the response
time from the server before the page starts loading that seems to
increase.

The page does use MySQL tables, but all are well indexed, and as I say,
you can load the page about 15 times, before any noticeable delay starts
to happen.

Anyone any ideas please?

(I've put the complete site on 2 different servers - 1 on a shared
hosting
account, and 1 on completely different managed server, and the same
thing happens on both servers!?).

Thanks,
Chris.

Hi Chris,

That indicates that your script has a higher workload the higher the
questionnumber is.
That could indicate that the script is doing more work for question
number 20 than for question number 1.

Do you only perform the quesries needed?
Are you maybe 'counting' by doing subsequent databasequeries untill you
pulled the 'right' question from the table(s)?

Regards,
Erwin Moller
Aug 2 '06 #4
On Wed, 2 Aug 2006 12:17:47 +0100, "Chris Thompson"
<c.********@zen.co.ukwrote:
>Hi All,

I have a private website created using HTML/PHP. Within this site, there is
a page that has a form (question.php), which is populated depending on the
question number that has been posted to it.

When the form is submitted, the data is posted back to the same page
(question.php), and the code within the page saves the posted data, and
displays the next question, and so it goes on...

While the page loads almost instantly for the first 15 or so questions, the
server response gets gradually slower, to the point where the page takes
about 30 secs to start loading after about 18 questions.
Is the page writing each set of responses to MySQL every time, or is
it mererly appending them to the form as a load of hidden form fields
- ready to be written when all questions have been answered?

--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Aug 3 '06 #5
Hi David,

Thanks for your reply... Although it wasn't the problem, it did get my
brain going in the right direction, so thankyou...

The problem was that I was passing a hidden field from question to question,
which had an apostrophe in it.

I was populating the hidden field with the posted version of itself on each
load of the page, without using the 'stripslashes' command, so PHP was
adding more and more slashes to the hidden field, every time the page was
posted.

I realised the problem, when I did a 'view source' of the page, and saw
pages and pages of \\\\\\\\\\\\\\\\\\\\\\\\\\

Obviously, the amount of slashes was doubling every time, and making the
HTML code being sent back to the client huge, and slowing the load down.

All sorted now.

Thanks to Erwin to, for his reply.

Regards,
Chris.
"David Quinton" <us****************@REMOVETHISBITbizorg.co.ukwro te in
message news:aj********************************@4ax.com...
On Wed, 2 Aug 2006 12:17:47 +0100, "Chris Thompson"
<c.********@zen.co.ukwrote:
>>Hi All,

I have a private website created using HTML/PHP. Within this site, there
is
a page that has a form (question.php), which is populated depending on the
question number that has been posted to it.

When the form is submitted, the data is posted back to the same page
(question.php), and the code within the page saves the posted data, and
displays the next question, and so it goes on...

While the page loads almost instantly for the first 15 or so questions,
the
server response gets gradually slower, to the point where the page takes
about 30 secs to start loading after about 18 questions.

Is the page writing each set of responses to MySQL every time, or is
it mererly appending them to the form as a load of hidden form fields
- ready to be written when all questions have been answered?

--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>

Aug 3 '06 #6
"Chris Thompson" <c.********@zen.co.ukwrote:
I was populating the hidden field with the posted version of itself on each
load of the page, without using the 'stripslashes' command, so PHP was
adding more and more slashes to the hidden field, every time the page was
posted.
magic_quotes is an abomination and a curse.

miguel
--
Photos from 40 countries on 5 continents: http://travel.u.nu
Latest photos: Malaysia; Thailand; Singapore; Spain; Morocco
Airports of the world: http://airport.u.nu
Aug 3 '06 #7
On Thu, 3 Aug 2006 14:42:59 +0100, "Chris Thompson"
<c.********@zen.co.ukwrote:
>Hi David,

Thanks for your reply... Although it wasn't the problem, it did get my
brain going in the right direction, so thankyou...
Excellent news!
It's always useful to get someone else to look at a prblem "from the
outside" IMO.
<G>
--
Locate your Mobile phone: <http://www.bizorg.co.uk/news.html>
Great gifts: <http://www.ThisBritain.com/ASOS_popup.html>
Aug 4 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: TheKeith | last post by:
I'm writing a script with a while loop in it. How can I get it to go slower so that it doesn't appear to happen all at once--so that it looks animated--basically. I tried the setTimeout(500) in the...
3
by: Dan Stromberg | last post by:
I have two different python programs that are slowing down quite a bit as their memory use goes up. I'm not really sure if this is some sort of CPU cache effect, or if it's something about...
7
by: davidst95 | last post by:
Hello, I have a program that runs a long process. I tried to add a thread to check if the use hit a cancel button to abort the process. Dim t As Threading.Thread t = New...
7
by: =?Utf-8?B?RWRkaWU=?= | last post by:
We have an odd situation with some of our single-threaded CPU-bound C++ programs. They run between 2 and 4 times faster on Windows XP than on windows Server 2003 on the same Xeon hyperthreading...
3
by: traceable1 | last post by:
I installed the SQL Server 2005 SP2 update 2 rollup on my 64-bit server and the performance has tanked! I installed rollup 3 on some of them, but that did not seem to help. I thought it...
1
by: maverickman4 | last post by:
background/setup info: so we have a network set up of about 23 computers including our server which is running windows 2003 standard. we have an incredible amount of traffic going to that server due...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
3
by: karl98 | last post by:
Does anyone else experience slowing down of a web conferencing session when 5 or more people join in the meeting? Our web conferences slow down considerably and are driving me nuts.
46
by: RAZZ | last post by:
Hello, Can anyone suggest me solution? I Need to manage different types of documents (doc,xls,ppt etc) in server. I have folder structure to maintain these documents in server. Say folder1 is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.