Submission Form Maxing out CPU
This topic contains 29 replies, has 3 voices, and was last updated by Kiran 4 years, 8 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
March 2, 2020 at 1:03 pm #533063
Hi guys,
Please can you help?
It seems as though every time a user submits a listing via the ‘add listing’ form, it’s taking up massive amounts of CPU resource on my server.
https://whatsonhub.co.uk/add-listing/?listing_type=gd_event
Do you know why and can you point me in the right direction on how to fix it?
Thanks,
DaveMarch 2, 2020 at 3:35 pm #533093There is a lot of activity when submitting a listing, but, are you seeing timeouts or something? Errors?
March 2, 2020 at 5:00 pm #533124That’s right. Most of the time, it will take a really long time to load the page, but then sometimes I’m getting database errors and the whole site goes down for about 30 seconds.
March 3, 2020 at 9:25 am #533252Hi Dave,
There must be a log at server end to check which function or a query consuming more time.
Please ask server admin to provide a log where the page submission stops and raises error also ask to provide a database error?Thanks,
KiranMarch 3, 2020 at 10:12 am #533262Thanks Kiran.
I contacted my hosting the other day and they said this:
From navigating the site the following query appears to be running when the rate limiting starts (although it is fairly constant suggesting the query is regularly run):
9994898 whatsonh_wp1 localhost whatsonh_wp1 Query 9 Sending data SELECT ( SELECT GROUP_CONCAT( DISTINCT CONCAT( DATE_FORMAT( wp_geodir_event_schedule.start_date, ‘%d%m%y’ ), ”, DATE_FORMAT( wp_geodir_event_schedule.end_date, ‘%d%m%y’ ) ) ) FROM wp_geodir_event_schedule WHERE ( ( ( ‘2020-02-01’ BETWEEN start_date AND end_date ) OR ( start_date BETWEEN ‘2020-02-01’ AND end_date ) ) AND ( ( ‘2020-02-29’ BETWEEN start_date AND end_date ) OR ( end_date BETWEEN start_date AND ‘2020-02-29’ ) ) ) AND wp_geodir_event_schedule.event_id = wp_posts.ID ) AS schedules FROM wp_posts LEFT JOIN wp_geodir_gd_event_detail ON wp_geodir_gd_event_detail.post_id = wp_posts.ID LEFT JOIN wp_geodir_event_schedule ON wp_geodir_event_schedule.event_id = wp_posts.ID WHERE 1=1 AND wp_posts.post_type = ‘gd_event’ AND ((wp_posts.post_status = ‘publish’)) AND wp_geodir_gd_event_detail.post_id > 0 AND ( ( ( ‘2020-02-01’ BETWEEN start_date AND end_date ) OR ( start_date BETWEEN ‘2020-02-01’ AND end_date ) ) AND ( ( ‘2020-02-29’ BETWEEN start_date AND end_date ) OR ( end_date BETWEEN start_date AND ‘2020-02-29’ ) ) ) ORDER BY wp_posts.post_date DESCDoes this help?
March 4, 2020 at 3:17 pm #533535This reply has been marked as private.March 4, 2020 at 8:53 pm #533616Hi guys, is there any news? My site is very temperamental right now and causing outages. I’d really appreciate your urgent help.
Thanks,
DaveMarch 4, 2020 at 9:36 pm #533624The developers will take a look again as soon as possible.
GeoDirectory isn’t recommended for shared hosts. You may want to try cloning your site to another provider, even just temporarily, to see if it helps with your concerns.
March 5, 2020 at 9:05 am #533703This reply has been marked as private.March 5, 2020 at 1:20 pm #533749Thanks Kiran, that’s been a big help. I’ve changed the max execution time to 45 seconds now instead and the site seems to be running much better.
As for those PHP notices, I’m not sure what they mean. Do undefined variables have an impact? And should I just go to Listimia theme about them and also AdRotate plugin?
Thanks,
DaveMarch 5, 2020 at 1:28 pm #533752Glad to hear that site speed improved.
For PHP notices it depends on usage of the variables that not found. Sometimes undefined PHP notices may show unexpected results. You can contact the plugin author about this errors.
Kiran
March 19, 2020 at 6:27 pm #535761Hi Kiran,
The site speed initially improved a few weeks ago but it’s happening again unfortunately.
I increased the max execution time again but nothing improved. I’ve now got the site in maintenance mode and because of the coronavirus outbreak, we have virtually no traffic to our site. So it’s a good opportunity to understand what’s causing spikes on our server CPU.
I asked the support team at my hosting provider (Guru), and they explained the following:
“I can see that this is still being limited by MySQL governor due to excessive resource usage.
Based on the command line tool for this, I can see your database queries alone appeared to be using 2 CPU cores at one stage.
At the time this resource consumption was taking place, I found the following query running which I believe is the same as the query mentioned previously by my colleague Mike.
==================================
SELECT ( SELECT GROUP_CONCAT( DISTINCT CONCAT( DATE_FORMAT( wp_geodir_event_schedule.start_date, ‘%d%m%y’ ), ”, DATE_FORMAT( wp_geodir_event_schedule.end_date, ‘%d%m%y’ ) ) ) FROM wp_geodir_event_schedule WHERE ( ( ( ‘2020-03-01’ BETWEEN start_date AND end_date ) OR (start_date BETWEEN ‘2020-03-01’ AND end_date ) ) AND ( ( ‘2020-03-31’ BETWEEN start_date AND end_date ) OR ( end_date BETWEEN start_date AND ‘2020-03-31’ ) ) ) AND wp_geodir_event_schedule.event_id = wp_posts.ID ) AS schedules FROM wp_posts LEFT JOIN wp_geodir_gd_event_detail ON wp_geodir_gd_event_detail.post_id = wp_posts.ID LEFT JOIN wp_geodir_event_schedule ON wp_geodir_event_schedule.event_id = wp_posts.ID WHERE 1=1 AND wp_posts.post_type = ‘gd_event’ AND ((wp_posts.post_status = ‘publish’)) AND wp_geodir_gd_event_detail.post_id > 0 AND ( ( ( ‘2020-03-01’ BETWEEN start_date AND end_date ) OR ( start_date BETWEEN ‘2020-03-01’ AND end_date ) ) AND ( ( ‘2020-03-31’ BETWEEN start_date AND end_date ) OR ( end_date BETWEEN start_date AND ‘2020-03-31’ ) ) ) ORDER BY wp_posts.post_date DESC
==================================Given that the site is in maintenance mode, it may be possible that the cron is triggering this query in some way.”
Do you know why the above command line might be causing these spikes? And if so, what can be done to fix it?
I’m guessing that those PHP undefined variables you mentioned before, won’t be causing this now, seen as the site is in maintenance mode and no traffic.
Please can you help?
Dave
March 20, 2020 at 10:28 am #535818Hi Dave,
Can you provide me phpmyadmin database access so i can check executing queries there to check how much time it taking? We never face similar issue before. Can you try increasing time limit to 100 or 120?
We have already task in todo to enhance calendar functionality.
Thanks,
KiranMarch 20, 2020 at 10:53 am #535819Thanks Kiran. Is that what is causing the issue… the event calendar?
If I install the phpmyadmin plugin to wordpress, will that give you the access that you need?
Thanks,
DaveMarch 20, 2020 at 11:04 am #535820That SQL query is executed on page where event calendar is displayed. This query is executed in AJAX mode.
If plugin allows to access database then just install on site it will check database from wordpress admin.
Kiran
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket