web based application shows message as time out and users logout

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.
D_wathiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dfkeCommented:
Hi,

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


Cheers
0
Martyn SpencerSoftware Developer / Linux System Administrator / Managing DirectorCommented:
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
0
D_wathiAuthor Commented:
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.
0
The Five Tenets of the Most Secure Backup

Data loss can hit a business in any number of ways. In reality, companies should expect to lose data at some point. The challenge is having a plan to recover from such an event.

David FavorLinux/LXD/WordPress/Hosting SavantCommented:
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.
1
Martyn SpencerSoftware Developer / Linux System Administrator / Managing DirectorCommented:
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.
0
D_wathiAuthor Commented:
have set as following in my.cnf
connect_timeout=28800
wait_timeout=28800
interactive_timeout=28800

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.
0
Martyn SpencerSoftware Developer / Linux System Administrator / Managing DirectorCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
D_wathiAuthor Commented:
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.
0
Martyn SpencerSoftware Developer / Linux System Administrator / Managing DirectorCommented:
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
date.timezone="Europe/London"

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.
0
D_wathiAuthor Commented:
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.
0
Martyn SpencerSoftware Developer / Linux System Administrator / Managing DirectorCommented:
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.
0
D_wathiAuthor Commented:
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,
/etc/php.d/apcu.ini,
/etc/php.d/bcmath.ini,
/etc/php.d/curl.ini,
/etc/php.d/dom.ini,
/etc/php.d/fileinfo.ini,
/etc/php.d/gd.ini,
/etc/php.d/gmp.ini,
/etc/php.d/imap.ini,
/etc/php.d/json.ini,
/etc/php.d/ldap.ini,
/etc/php.d/mbstring.ini,
/etc/php.d/memcache.ini,
/etc/php.d/mssql.ini,
/etc/php.d/mysql.ini,
/etc/php.d/mysqli.ini,
/etc/php.d/pdo.ini,
/etc/php.d/pdo_dblib.ini,
/etc/php.d/pdo_mysql.ini,
/etc/php.d/pdo_sqlite.ini,
/etc/php.d/phar.ini,
/etc/php.d/posix.ini,
/etc/php.d/soap.ini,
/etc/php.d/sqlite3.ini,
/etc/php.d/sybase_ct.ini,
/etc/php.d/sysvmsg.ini,
/etc/php.d/sysvsem.ini,
/etc/php.d/sysvshm.ini,
/etc/php.d/wddx.ini,
/etc/php.d/xmlreader.ini,
/etc/php.d/xmlwriter.ini,
/etc/php.d/xsl.ini,
/etc/php.d/zip.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
extension=apc.so
apc.shm_size=1028M
apc.shm_segments=1
apc.max_file_size=5M
apc.num_files_hint=10000
apc.slam_defense = 0
apc.write_lock=1
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.