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
  • Author
    Posts
  • #533063

    Dave
    Full Member
    Post count: 205

    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,
    Dave

    #533093

    Alex Rollin
    Moderator
    Post count: 27815

    There is a lot of activity when submitting a listing, but, are you seeing timeouts or something? Errors?

    #533124

    Dave
    Full Member
    Post count: 205

    That’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.

    #533252

    Kiran
    Moderator
    Post count: 7069

    Hi 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,
    Kiran

    #533262

    Dave
    Full Member
    Post count: 205

    Thanks 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 DESC

    Does this help?

    #533535

    Dave
    Full Member
    Post count: 205
    This reply has been marked as private.
    #533616

    Dave
    Full Member
    Post count: 205

    Hi guys, is there any news? My site is very temperamental right now and causing outages. I’d really appreciate your urgent help.

    Thanks,
    Dave

    #533624

    Alex Rollin
    Moderator
    Post count: 27815

    The 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.

    https://wpgeodirectory.com/docs-v2/faq/server-requirements/

    #533703

    Kiran
    Moderator
    Post count: 7069
    This reply has been marked as private.
    #533749

    Dave
    Full Member
    Post count: 205

    Thanks 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,
    Dave

    #533752

    Kiran
    Moderator
    Post count: 7069

    Glad 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

    #535761

    Dave
    Full Member
    Post count: 205

    Hi 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

    #535818

    Kiran
    Moderator
    Post count: 7069

    Hi 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,
    Kiran

    #535819

    Dave
    Full Member
    Post count: 205

    Thanks 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,
    Dave

    #535820

    Kiran
    Moderator
    Post count: 7069

    That 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

Viewing 15 posts - 1 through 15 (of 30 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount