Webmaster Forum

Go Back   Webmaster Forum > Web Development > Coding Forum

Coding Forum Problems with your code? Discuss coding issues, including JavaScript, PHP & MySQL, HTML & CSS, Flash & ActionScript, and more.


Reply
 
Thread Tools Display Modes
Share |
  #1  
Old 05-06-2017, 04:02 PM
imadam's Avatar
imadam imadam is offline
Contributing Member
 
Join Date: 12-06-09
Location: guildford
Posts: 355
iTrader: 0 / 0%
how to find what is taking so long on a form submission? php/mysql

i have a form that when submitted, works out a total, saves the input information to a mysql database, emails a copy and then displays the quote to the user.

this can sometimes take a good 10 seconds to do when it's the first time done. if i go back edit the quote and click submit then it can be instant.

i suspect the slow down is coming from mysql, only because it's at this point that the database connection is first opened, and then from then on it's been opened once i guess the second time isn't so slow, but this is just a gut feeling.

any suggestions as to how you'd go about finding out what is slow?

this is written in php/mysql
 
Reply With Quote

Advertisement

Advertisement

  #2  
Old 05-07-2017, 07:19 AM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,018
iTrader: 4 / 100%
Localhost or production server?

Allowed open DB connections on either?
 
Reply With Quote
  #3  
Old 05-07-2017, 02:30 PM
inventive inventive is offline
Contributing Member
 
Join Date: 03-10-13
Location: Yorkshire, UK
Posts: 96
iTrader: 0 / 0%
Have you checked the server load around the time a form is submitted - Best to check the CPU and RAM usage - if it is high this could be causing the delay.

Also check MySQL connections during the time of the submission.
 
Reply With Quote
  #4  
Old 05-08-2017, 09:09 AM
imadam's Avatar
imadam imadam is offline
Contributing Member
 
Join Date: 12-06-09
Location: guildford
Posts: 355
iTrader: 0 / 0%
Quote:
Originally Posted by ScriptMan View Post
Localhost or production server?

Allowed open DB connections on either?
both local and production.

not that i'm aware of. how would i check?
 
Reply With Quote
  #5  
Old 05-09-2017, 06:46 AM
ScriptMan's Avatar
ScriptMan ScriptMan is online now
Super Moderator
 
Join Date: 02-10-07
Location: Central Kentucky
Posts: 14,018
iTrader: 4 / 100%
I doubt you have a lot of load on localhost. An email problem is more likely there.

On local only enable full error reporting and see if anything pops up.
Disable the email portion on either and see if it works better.
Add the mysql connect to a separate file and include that file at the top of your script so that the connection is open when you start.

Witout studing the problem thats about all I can think of to suggest.
 
Reply With Quote
Go Back   Webmaster Forum > Web Development > Coding Forum

Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


V7N Network
Get exposure! V7N I Love Photography V7N SEO Blog V7N Directory


All times are GMT -7. The time now is 11:26 AM.
Powered by vBulletin
Copyright 2000-2014 Jelsoft Enterprises Limited.
Copyright © 2003 - 2018 VIX-WomensForum LLC