0

I need your help badly in determining the cause of this problem. This is a hotel management system that keeps track of checked in guests and monitors them if their time is up. I'm using setTimeout as suggested by Mr. A. Wolff (Slow website after some time (with ajax interval of 10 seconds)) in this discussion. It's reloading the content every 5 seconds now but as you can see, the debugger is consuming 10 seconds in getting 56KB of data.

The problem still exists. I have done my researches about modals and timeouts and I am close to giving up. I just need a clue on where to start.

The computer is where the files are located. Technically, it's a server and at the same time, being used as a client for the system.

Here's a screenshot for the debugger. Thank you.

JS Debugger using Chrome

UPDATE: I removed the setTimeout from the function itself so basically, nothing's reloading the page. Then I opened a checkin page, things got faster, and I mean so fast now. So I think this is what I need to do, I need to stop the function from reloading the page IF I OPEN A MODAL. The reason is that, if the modal closes, it's going to reload the PAGE anyway. So it must be a good idea to stop the recurring function when a modal is opened. Any suggestions?

UPDATE 2: Here's the link of the script being executed: https://www.dropbox.com/s/azi51w0pzp69kgh/checkin.php

Here's the live site: http://greenenergiesllc.com/temp

Login: removed by moderator

Password : removed by moderator

6
  • If the server is spending 10secs to give you your data it definitely looks like a SQL query gone wrong. It's possible that the web+dbserver is spending most of that time working on getting and compiling the data for you from the database. I think you should dive into the server-side code which serves you this content and find out what's taking it 10seconds. Commented Mar 9, 2014 at 10:53
  • hi. Thank you for spending your time. I appreciate it. I made some changes and removed the recurring function, a function that's reloading the content every 5 seconds. When I opened a modal, it was way fast now. So what I need to do is to stop the function IF a modal has been opened. Any suggestions? Thanks! Commented Mar 9, 2014 at 11:00
  • You don't have any code uploaded in your question for others to know what exactly you are trying to do with setTimeout. If you want to stop the timer you can use clearTimeout. Google it to see the usage. Commented Mar 9, 2014 at 11:03
  • Cleartimeout works. Thank you Thank you. Now, I need to set clearTImeout for every modal being opened. The reason is I don't want it to continuously fetch data while I'm saving some. Performance issues when having a fetcher while saving. Commented Mar 9, 2014 at 11:20
  • You are welcome. And unless you are asking to be hacked please do not post logins to websites publicly. Considering your site is still under development there are bound to be security loopholes which attackers can take advantage of. If you really need to share a password with someone just ask for a private chat. Commented Mar 9, 2014 at 11:25

1 Answer 1

1

i suggest you don't use settimeout,use setinterval for 5 sec instead of it. if you pull large data from server you must use json. and also don't create js timer in same time,the server couldn't response over ajax requests.

Sign up to request clarification or add additional context in comments.

1 Comment

Hi Thank you for your response. I changed the setTimeout to setInterval. Same results, I get the new content in more than 5 seconds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.