web based application shows message as time out and users logout

D_wathi used Ask the Experts™
Dear Experts

in linux server of centos,  we are running crm which is web based application apache, mysql and php once in few hours users are getting timeout and this is affecting very badly,
1. would like to fetch the log reports of server resources consumption like  RAM, CPU to understand the issue is occurring due to over load of that particular time.
2.  would like to fetch apache logs and mysql logs of that particular time
to determine the time that users are facing issues of application time out , Can I ask software developer to provide me time out occurred and application closed  date and time and during that time check the server resource utilisation which will help me to trace the issue is it due to server or application level.
please help on best practice on such cases.
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

you can alter the time out values for that.

Something like:

con.query('SET GLOBAL connect_timeout=28800')
con.query('SET GLOBAL wait_timeout=28800')
con.query('SET GLOBAL interactive_timeout=28800')

Open in new window

Martyn SpencerSoftware Developer / Linux System Administrator / Managing Director

If it were me, I would be checking for long-running queries, blocking database locks and storage system metrics (errors, performance etc). You need to pick somewhere to start, so long running queries would be a good place, I feel. It is likely that one or more users are stressing the server and causing time-outs.

Take a look here as a starting point: https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html


thanks for the reply, should this be done on my.cnf on database server please suggest OR should have to login to mysql server with root and execute it as mysql root user please suggest.
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

David FavorFractional CTO
Distinguished Expert 2018
Try running mysqltuner + add any suggested tunings to your system.

Be sure you're running Apache + mod_event + FPM PHP + enable deep logging in FPM so you can see if PHP is the culprit.
Martyn SpencerSoftware Developer / Linux System Administrator / Managing Director

Changes to the configuration would be in my.cnf (in the relevant location for your installation - usually /etc/my.cnf). David's suggestion to use mysqltuner and the other tools is also a good idea as it can help pinpoint problems with your configuration and offer tuning hints.


have set as following in my.cnf

these values earlier was set to 6000 now I have changed it to as above.

2. also there is continuous log web application as showing as fatal
Fri Sep  7 05:03:50 2018 [27413][-none-][FATAL] Configuration variable date.timezone is not set, guessed timezone UTC. Please set date.timezone="UTC" in php.ini!

though i set it in php.ini still the same showing up and the system time zone is EDT, please suggest how to set date.time for EDT and is there anything else to be  to done.
Software Developer / Linux System Administrator / Managing Director
If you run
php --ini

Open in new window

you will see which php ini files are used. If you want more info, check here: https://stackoverflow.com/questions/8684609/wheres-my-php-ini#8684638

You should edit the primary ini file and specify your time zone (not necessarily UTC) using the date.timezone="XXX" directive, where XXX is your time zone. You can find a list of valid time zones here: https://secure.php.net/manual/en/timezones.php

You may find that there is already a date.timezone entry in the file, but it may be commented out with a semicolon (;).

For web pages, I generally restart the web server having updated the ini file and if you have not done this may be why you have not seen the change you made take effect.


thanks for the reply, it is required to set EDT but iam not getting how to set for EDT time zone can you please help me, is it just set as date.timezone="EDT"  please suggest.
Martyn SpencerSoftware Developer / Linux System Administrator / Managing Director

Please refer to my comment. There is a link that you can follow to find the valid time zone. For example, here in the UK I would use

Open in new window

Also, please note that my suggested command to locate the ini will locate the CLI interpreter ini file. If you want the one used by the web server, follow the link I gave as there are more instructions there. Basically, you can create a phpinfo page (don't make it public) and it will show the location of the .ini file.


can you please let me know , performing indexing be some helpful on mysql server
1. Is it possible to perform the indexing on only huge size tables.
2. if the indexing is in progress can the users still work.
3. if the indexing is in progress can it be stopped and resume later from where we left OR at least can we completely stop.
4. is it recommended to take backup before performing indexing.
5. please help me on how to list the huge size tables and how to find the total database size
6. how to run indexing on specific tables which has is huge in size.
this will be great help.
Martyn SpencerSoftware Developer / Linux System Administrator / Managing Director

1. You can index any table, large or small. The benefits of indexing will depend on how the data is accessed and it is unlikely that an index will be used for a small table, since it is more efficient to just scan the rows.

2. That depends on the database version. If you are using 5.6 or higher, it should support indexes being created and dropped while users are working on the data.

3. I am not aware of any mechanism for pausing and restarting indexing. Usually a database will prioritise index generation appropriately.

4. It should not be necessary to take a backup, since the index is based on data already in the database.

5. Take a look here: https://stackoverflow.com/questions/9620198/how-to-get-the-sizes-of-the-tables-of-a-mysql-database

6. Define huge. Indexing small or large tables is the same. It will naturally take longer to index a larger table. You need sufficient disk space for the new index, but the database should handle it if you were to run out of disk space.

Don't just create indexes randomly. You should be analysing access patterns. Indexes slow down database updates and if they are never used in queries, they actually become an unnecessary overhead.


thank you very much for the reply and inputs,  though I set data and time zone as following in /etc/php.ini  to date.timezone="America/New_York" and did httpd restart still it is not taking this. I did check for other php.ini in /etc/httpd or other location is not there and only available and loaded is /etc/php.ini  please fin the below details
php --ini
PHP Warning:  Module 'apc' already loaded in Unknown on line 0
Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /etc/php.d
Additional .ini files parsed:      /etc/php.d/apc.ini,
1. also above shows apc module already loaded in unknown please suggest me what to do here
2. please suggest is following values are correct or to be changed so that performance will be better
apc.slam_defense = 0

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial