ERR_CONNECTION_TIMED_OUT ERR_CONNECTION_REFUSED

Asked

Viewed 697 times

3

I am developing a system that uses HTML, JS, PHP and Mysql. The pages have several AJAX calls to the bank. I have today approximately 350 users.

Lately I’ve been getting a lot of mistakes from:

  • ERR_CONNECTION_TIMED_OUT
  • ERR_CONNECTION_REFUSED
  • And others.

Users are also having these problems.

A basic view of my system:

  • The system is hosted on LOCAWEB
  • Utilise SESSION
  • All queries are located in separate PHP files as per my need.
  • There are some functions that use file_get_contents(), because I need to search user data on another site.
  • All pages have their own JS file for separating the functions I need.
  • I use the theme ADMINLTE as a basis.


I ask you:

  • How these errors relate to my system?
  • Would be some wrong configuration on PHP.INI?

NOTE: for local test, I use the WAMP, and never had problems.

  • 2

    Does apache log show anything? Errors indicate server overload, now at which point you have no way of knowing.

  • In the LOCAWEB log, you have many of these errors: mod_mime_magic: invalid type 0 in mconvert()

  • you use the file_get_contents() to 'connect' and pick up information from other websites?

  • Yes. I just saw another error: Modsecurity: Error Reading request body: Partial Results are Valid but Processing is incomplete

  • 1

    you need to isolate the problem, check the files or functions that use the file_get_contents(), it will depend on the response time of the localweb server to request with the other site, by default a request lasts 30 seconds longer than that, the script is aborted.

  • I’ve set: max_input_time = -1 e max_execution_time = 3600 .

  • 1

    The external site may also block the server’s ip, thinking it is a Flood attempt or denial of service attack, which consists of sending a large number of requests that the server cannot handle.

Show 2 more comments

1 answer

0

With just the past information you can’t give a conclusive answer as to what might be causing the slowness in the system, but we can analyze point by point your basic view of your system to help you discover and fix the problem:

- The system is hosted at LOCAWEB

It is not up to me to speak bad or good of Locaweb, but test on another server and if on the other server no more error, problem solved.

- Utilizo SESSION

I see no problem relation of slowness with use of Septssion, skip to next.

- All queries are located in separate PHP files as per my need.

It is indifferent the number of files used. Skip to next.

- There are some functions that use file_get_contents(), because I need to search users' data on another site.

If the external site is slow or blocking your IP, there may be your problem. Try to isolate this code, test it and if possible see an alternative to it, how to use a webservice of this external site or have a user of yours accessing the database of the external site - Everything will depend on your relationship with the responsible for this external site.

All pages have their own JS file for separating the functions I need.

Indifferent. Skip to next.

I use the ADMINLTE theme as a base.

Indifferent too.

Pages have multiple AJAX calls to the bank.

See how much time you make these ajax calls. Database is a costly resource. Although the use of ajax alone has no impact on speed, check your queries. Sometimes you may be searching more than you need, it’s good to use LIMIT in queries, limiting the number of records returned, and setting indexes for the fields used in the WHERE clauses.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.