{"id":1397019,"date":"2017-12-01T15:31:20","date_gmt":"2017-12-01T23:31:20","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/"},"modified":"2017-12-01T15:31:20","modified_gmt":"2017-12-01T23:31:20","slug":"too-many-system-resources-used-for-mysql","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/","title":{"rendered":"Too Many System Resources Used for MYSQL"},"content":{"rendered":"<p>Hello Support,<\/p>\n<p>The server is reporting too many system resources being used.  I have tweaked the calendar using the suggestions from other posts including caching, reducing the amount of posts being displayed.  Tried a different view other than month view (week looks terrible!) so anything else is unacceptable.  These tweaks have helped, but not quite there yet.<\/p>\n<p>We&#8217;ve been running this calendar for at least 3 years now.  Is it possible that there are too many old entries that is causing the database to be slow and use too many resources?  Is there a way to clean the database to get rid of past years events?<\/p>\n<p>Maybe the error log will point as to what exactly is slowing things down?  Additional pointers in the right direction would be appreciated.<\/p>\n<p>Here is what the server spit out:<br \/>\nCPU_TIME:991    table_rows_read:70749375        SELECTS:10614   ROWS_UPDATED:9  ROWS_FETCHED:82667      BUSY_TIME:1180  ONNECTED_TIME:1284      BYTES_SENT:11366112     BYTES_RECEIVED:2136277  WAIT_TIME:189<\/p>\n<p>Top table row reads:<br \/>\nDB_USER: csvac_wrdp1 &#8212; TOTAL_CONNECTIONS: 110 &#8212; CONNECTED_TIME: 1284 &#8212; CPU_TIME: 991 &#8212; TABLE_ROW_READS: 70749376 &#8212; SELECT_COMMANDS: 10615 &#8212; UPDATE_COMMANDS:  &#8212; BUSY_TIME: 1180 &#8212; BYTES_SENT: 11366112 &#8212; BYTES_RECEIVED: 2136329 &#8212; WAIT_TIME (IO): 189<\/p>\n<p>Top WAIT (IO) TIME:<br \/>\nDB_USER: csvac_wrdp1 &#8212; TOTAL_CONNECTIONS: 110 &#8212; CONNECTED_TIME: 1284 &#8212; CPU_TIME: 991 &#8212; TABLE_ROW_READS: 70749376 &#8212; SELECT_COMMANDS: 10615 &#8212; UPDATE_COMMANDS:  &#8212; BUSY_TIME: 1180 &#8212; BYTES_SENT: 11366112 &#8212; BYTES_RECEIVED: 2136329 &#8212; WAIT_TIME (IO): 189<\/p>\n<p>csvac     706823 10.0  0.2 292920 44940 ?        SN   21:59   0:01 \/opt\/php71\/bin\/php-cgi \/home\/csvac\/public_html\/index.php<br \/>\ncsvac     706912  9.1  0.2 292920 44932 ?        SN   21:59   0:00 \/opt\/php71\/bin\/php-cgi \/home\/csvac\/public_html\/index.php<br \/>\ncsvac     706920 10.1  0.2 292532 44188 ?        SN   21:59   0:00 \/opt\/php71\/bin\/php-cgi \/home\/csvac\/public_html\/index.php<\/p>\n<p>Tue Nov 28 21:59:36 CST 2017<br \/>\nRunning Processes:<br \/>\ncsvac   706823 10.0  0.2 292920 44940 ?        SN   21:59   0:01 \/opt\/php71\/bin\/php-cgi \/home\/csvac\/public_html\/index.php<br \/>\ncsvac   706912  9.1  0.2 292920 44932 ?        SN   21:59   0:00 \/opt\/php71\/bin\/php-cgi \/home\/csvac\/public_html\/index.php<br \/>\ncsvac   706920 10.1  0.2 292532 44188 ?        SN   21:59   0:00 \/opt\/php71\/bin\/php-cgi \/home\/csvac\/public_html\/index.php<\/p>\n<p>Running Queries:<br \/>\n*************************** 1. row ***************************<br \/>\n   USER: csvac_wrdp1<br \/>\n     DB: csvac_wrdp1<br \/>\n  STATE: Copying to tmp table<br \/>\n   TIME: 2<br \/>\nCOMMAND: Query<br \/>\n   INFO: SELECT<br \/>\n                                SQL_CALC_FOUND_ROWS *<br \/>\n                        FROM (<br \/>\n                                SELECT  DISTINCT wp_posts.*, wp_postmeta.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate FROM wp_posts  LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )  LEFT JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id )  LEFT JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id AND mt2.meta_key = &#8216;_EventHideFromUpcoming&#8217; ) LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = &#8216;_EventEndDate&#8217; )  WHERE 1=1  AND wp_posts.ID NOT IN (11116) AND (<br \/>\n  wp_postmeta.meta_key = &#8216;_EventStartDate&#8217;<br \/>\n  AND<br \/>\n   (<br \/>\n                                        ( mt1.meta_key = &#8216;_EventStartDate&#8217; AND CAST(mt1.meta_value AS DATETIME) &gt; &#8216;2016-11-30 09:30:00&#8217; )<br \/>\n                                        OR (<br \/>\n                                                ( mt1.meta_key = &#8216;_EventStartDate&#8217; AND CAST(mt1.meta_value AS DATETIME) = &#8216;2016-11-30 09:30:00&#8217; )<br \/>\n                                                AND mt1.post_id &gt; 11116<br \/>\n                                        )<br \/>\n                                )<br \/>\n  AND<br \/>\n  mt2.post_id IS NULL<br \/>\n) AND wp_posts.post_type = &#8216;tribe_events&#8217; AND (wp_posts.post_status = &#8216;publish&#8217; OR wp_posts.post_status = &#8216;tribe-ea-success&#8217; OR wp_posts.post_status = &#8216;tribe-ea-failed&#8217; OR wp_posts.post_status = &#8216;tribe-ea-schedule&#8217; OR wp_posts.post_status = &#8216;tribe-ea-pending&#8217; OR wp_posts.post_status = &#8216;tribe-ea-draft&#8217;)  ORDER BY EventStartDate ASC, wp_posts.ID ASC<br \/>\n                        ) a<br \/>\n                        GROUP BY IF( post_parent = 0, ID, post_parent )<br \/>\n                        ORDER BY EventStartDate ASC<br \/>\n                        LIMIT 0, 1<br \/>\n*************************** 2. row ***************************<br \/>\n   USER: csvac_wrdp1<br \/>\n     DB: csvac_wrdp1<br \/>\n  STATE: Sending data<br \/>\n   TIME: 1<br \/>\nCOMMAND: Query<br \/>\n   INFO: SELECT     meta_value<br \/>\n                        FROM       wp_postmeta m<br \/>\n                        INNER JOIN wp_posts p ON p.ID=m.post_id<br \/>\n                                   AND ( p.post_parent=10482 OR p.ID=10482 )<\/p>\n<p>                        WHERE meta_key = &#8216;_EventStartDate&#8217;<br \/>\n                              AND post_type = &#8216;tribe_events&#8217;<br \/>\n                              AND post_status NOT IN ( &#8216;inherit&#8217;, &#8216;auto-draft&#8217;, &#8216;trash&#8217; )<\/p>\n<p>                        ORDER BY meta_value ASC<br \/>\n*************************** 3. row ***************************<br \/>\n   USER: csvac_wrdp1<br \/>\n     DB: csvac_wrdp1<br \/>\n  STATE: Copying to tmp table<br \/>\n   TIME: 2<br \/>\nCOMMAND: Query<br \/>\n   INFO: SELECT<br \/>\n                                SQL_CALC_FOUND_ROWS *<br \/>\n                        FROM (<br \/>\n                                SELECT  DISTINCT wp_posts.*, wp_postmeta.meta_value as EventStartDate, tribe_event_end_date.meta_value as EventEndDate FROM wp_posts  LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )  LEFT JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id )  LEFT JOIN wp_postmeta AS mt2 ON (wp_posts.ID = mt2.post_id AND mt2.meta_key = &#8216;_EventHideFromUpcoming&#8217; ) LEFT JOIN wp_postmeta as tribe_event_end_date ON ( wp_posts.ID = tribe_event_end_date.post_id AND tribe_event_end_date.meta_key = &#8216;_EventEndDate&#8217; )  WHERE 1=1  AND wp_posts.ID NOT IN (12386) AND (<br \/>\n  wp_postmeta.meta_key = &#8216;_EventStartDate&#8217;<br \/>\n  AND<br \/>\n   (<br \/>\n                                        ( mt1.meta_key = &#8216;_EventStartDate&#8217; AND CAST(mt1.meta_value AS DATETIME) &gt; &#8216;2017-06-24 13:00:00&#8217; )<br \/>\n                                        OR (<br \/>\n                                                ( mt1.meta_key = &#8216;_EventStartDate&#8217; AND CAST(mt1.meta_value AS DATETIME) = &#8216;2017-06-24 13:00:00&#8217; )<br \/>\n                                                AND mt1.post_id &gt; 12386<br \/>\n                                        )<br \/>\n                                )<br \/>\n  AND<br \/>\n  mt2.post_id IS NULL<br \/>\n) AND wp_posts.post_type = &#8216;tribe_events&#8217; AND (wp_posts.post_status = &#8216;publish&#8217; OR wp_posts.post_status = &#8216;tribe-ea-success&#8217; OR wp_posts.post_status = &#8216;tribe-ea-failed&#8217; OR wp_posts.post_status = &#8216;tribe-ea-schedule&#8217; OR wp_posts.post_status = &#8216;tribe-ea-pending&#8217; OR wp_posts.post_status = &#8216;tribe-ea-draft&#8217;)  ORDER BY EventStartDate ASC, wp_posts.ID ASC<br \/>\n                        ) a<br \/>\n                        GROUP BY IF( post_parent = 0, ID, post_parent )<br \/>\n                        ORDER BY EventStartDate ASC<br \/>\n                        LIMIT 0, 1<\/p>\n<p>Open connections<\/p>\n<p>Current Site Requests:<\/p>\n","protected":false},"template":"","class_list":["post-1397019","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Too Many System Resources Used for MYSQL -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Too Many System Resources Used for MYSQL -\" \/>\n<meta property=\"og:description\" content=\"Hello Support, The server is reporting too many system resources being used. I have tweaked the calendar using the suggestions from other posts including caching, reducing the amount of posts being displayed. Tried a different view other than month view (week looks terrible!) so anything else is unacceptable. These tweaks have helped, but not quite [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/\",\"name\":\"Too Many System Resources Used for MYSQL -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-12-01T23:31:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Too Many System Resources Used for MYSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Too Many System Resources Used for MYSQL -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/","og_locale":"en_US","og_type":"article","og_title":"Too Many System Resources Used for MYSQL -","og_description":"Hello Support, The server is reporting too many system resources being used. I have tweaked the calendar using the suggestions from other posts including caching, reducing the amount of posts being displayed. Tried a different view other than month view (week looks terrible!) so anything else is unacceptable. These tweaks have helped, but not quite [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/","name":"Too Many System Resources Used for MYSQL -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-12-01T23:31:20+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/too-many-system-resources-used-for-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"Too Many System Resources Used for MYSQL"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1397019","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1397019\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1397019"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}