{"id":1324328,"date":"2017-07-21T07:57:44","date_gmt":"2017-07-21T14:57:44","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/"},"modified":"2017-07-21T07:57:44","modified_gmt":"2017-07-21T14:57:44","slug":"calendars-memory-use-crashing-server","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/","title":{"rendered":"Calendar&#039;s memory use crashing server"},"content":{"rendered":"<p>We&#8217;re running 20+ installations of Pro in 5 multisite installations on a dedicated server.<\/p>\n<p>Our hosting support team has identified processes run by the calendar that cause the server to run out of 16 GB of memory:<\/p>\n<p>I have also checked the script execution logs from the same time period and noticed that at several points, a few of your applications have executed multiple simultaneous wp-cron.php requests. For example, all of these requests were started in only 5 minutes: <\/p>\n<p>(he then listed them)<\/p>\n<p>There are multiple wp-cron requests which are executed on a constant basis and appear to be the main cause for the large consumption of memory.<\/p>\n<p>These tasks are part of the Events Calendar plugin which is present in each of the installations I tested. What we can suggest you to try for now is to try increasing the time period needed for execution of these events. There are several ways to do that.<\/p>\n<p>The first one is to make sure that each cron process cannot run more than once during the predefined cron lock timeout period. Such value can be defined by adding this code in the wp-config file of each of your WordPress installations:<\/p>\n<p>Code:<br \/>\ndefine( &#8216;WP_CRON_LOCK_TIMEOUT&#8217;, 120 );<\/p>\n<p>The shown example sets this period for 2 minutes, but you can modify this value to a larger one.<\/p>\n<p>NOTE: We tried this, and the calendar hangs in the dashboard. It stopped hanging after we reversed this solution.<\/p>\n<p>THIS ALSO WAS SUGGESTED:<\/p>\n<p>Another approach you may take is to enable the alternate cron functionality of WordPress:<\/p>\n<p>Code:<br \/>\ndefine( &#8216;ALTERNATE_WP_CRON&#8217;, true );<\/p>\n<p>After that you can navigate to the Cron jobs tool in cPanel and define the timeframe at which the wp-cron script to be executed.<\/p>\n<p>QUESTION: Do you recommend this solution? Will it also cause performance issues in the dashboard? Or do you have another solution?<\/p>\n","protected":false},"template":"","class_list":["post-1324328","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>Calendar&#039;s memory use crashing server -<\/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\/calendars-memory-use-crashing-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Calendar&#039;s memory use crashing server -\" \/>\n<meta property=\"og:description\" content=\"We&#8217;re running 20+ installations of Pro in 5 multisite installations on a dedicated server. Our hosting support team has identified processes run by the calendar that cause the server to run out of 16 GB of memory: I have also checked the script execution logs from the same time period and noticed that at several [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/\" \/>\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=\"2 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\/calendars-memory-use-crashing-server\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/\",\"name\":\"Calendar&#039;s memory use crashing server -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-07-21T14:57:44+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/#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\":\"Calendar&#039;s memory use crashing server\"}]},{\"@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":"Calendar&#039;s memory use crashing server -","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\/calendars-memory-use-crashing-server\/","og_locale":"en_US","og_type":"article","og_title":"Calendar&#039;s memory use crashing server -","og_description":"We&#8217;re running 20+ installations of Pro in 5 multisite installations on a dedicated server. Our hosting support team has identified processes run by the calendar that cause the server to run out of 16 GB of memory: I have also checked the script execution logs from the same time period and noticed that at several [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/","name":"Calendar&#039;s memory use crashing server -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-07-21T14:57:44+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/calendars-memory-use-crashing-server\/#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":"Calendar&#039;s memory use crashing server"}]},{"@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\/1324328","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\/1324328\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1324328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}