Search the Community
Showing results for tags 'ram'.
-
I am creating a module that sends pages as en email. I use ->render() to get the content of a PW page and send it as the body of the mail. But something is wrong and I am running out of memory (currently set to 100 MB). This function checks, if there is a page flagged for sending. $mailtempplate is the corpus delicti … public function checkSchedule($event) { // Memory usage $memory = 'Memory Start: ' . memory_get_usage(); wire('session')->message($memory); // Find pages, that are scheduled and have a schedule date that is older than current time plus 60 seconds $scheduled_pages = wire('pages')->find('template=newsletter-mailing, schedule=1, schedule_date<=' . time() + 60); // Check if there are scheduled pages, and stop, if nothing is scheduled if (!count($scheduled_pages)) { return; } // Iterate scheduled pages foreach ($scheduled_pages as $scheduled_page) { // Get the mail-template, i.e. the rendered page (this becomes the mail-body later) // If I just use $mailtemplate = 'Test'; everything works fine $mailtemplate = $scheduled_page->render(); // Convert local/relative paths to absolute URL for links (href) and images (src) if (!strpos($mailtemplate,'href="/') === false) { $mailtemplate = str_replace('href="/', 'href="' . wire('config')->httpUrl, $mailtemplate); } if (!strpos($mailtemplate,'src="/') === false) { $mailtemplate = str_replace('src="/', 'src="' . wire('config')->httpUrl, $mailtemplate); } // Dispatch this scheduled page ("Newsletter") for email $dispatched = $this->dispatchMailing($scheduled_page->title, $scheduled_page->newsletter_recipients, $mailtemplate); if ($dispatched) { $memory .= ' und Memory Ende: ' . memory_get_usage(); // Send reporting mail mail(…); } else { // Something went wrong while sending mail(…); } // Uncheck schedule checkbox, even if there was an error whiele sending! $p = $scheduled_page; $p->schedule = 0; $p->save(); // Clear the mailtemplate for the next scheduled page/mailing unset($mailtemplate); } } I moved $mailtemplate = $scheduled_page->render() out of the foreach() but it doesn't work either. Appreciate any help and tips
-
Hi everyone, let me first start off by expressing how much I love Processwire, I've succesfully integrated it with about 8 sites now and I'm just so in love with the simplicity (we love you ryan ) I was wondering how processwire scores on the performance/serverload front, how much processwires can I run on my VM with how much ram and are there any recommoned server apache settings? currently I'm running an ubuntu with 4GB ram and 3 cores (1,6Ghz each), I'm using php 5.1 with mod_cgi and the 8 processwire sites use about 1,6GB of RAM, having about 50k visitors/month across these sites I'm wondering how processwire will perform in case of 100k - 200k - 500k - 1M visitors, will the session system last (I noticed it's writing a cached file to the filesystem)? also: what's the limit with the "new Page();" command, is it creating a new directory for every created page, what's the limit (the filesystem? the amout of ram?)
- 3 replies
-
- performance
- server
- (and 4 more)