Forums

How to prevent 503 error?

efimleonid 12 Jan, 2016
I load my gallery using Choronoforms5 with display Message, that include an array of all my images from dataBase. I use the next constraction:
<?php
$results = array();
foreach ($form->data['images'] as $v ) {
  $results[] = $v['imgData'];
}
krsort($results);
$form->data['result'] = implode($results);
?>
and {result} in massage text.

The problem is that some images provide 503 error. DOM is perfect, so I think the problem is in big message text, that cause multiple server requests. Is it possible to load on page separated massages with some cycle? Maybe there is some other way to prevent the errors?
GreyHead 12 Jan, 2016
Hi efimleonid,

It's not possible to say much from the information here. Have you checked with your web host?

Are these images that you have saved or just text referring to the images?

How much data are you trying to process? How many records and of what size?

Bob
efimleonid 12 Jan, 2016
I save images to database table using Chronoforms5 and imgData contains following records:

<div class='imgDiv stClas obHous im3max'>{modal content=content20151214080043|group=mygroup|initialWidth=100%|initialHeight=100%}<div class='img_big'><img src='http://www.studio116.ru/images/big_20151214080043_7.jpg' alt='Some text' /></div>{/modal}{modalcontent content20151214080043} <div class='modal_full'><div class='modal_right'><div class='modal_right_inside'><h2>Some text</h2><hr/><p>Some text</p><hr/><p><strong style='font-size: 1.1em;'>Some text</strong> <a href='http://www.studio116.ru/index.php/'>Some text</a></p></div></div><div class='modal_left'><div class='modal_img'><img src='http://www.studio116.ru/images/20151214080043_7.jpg' alt='Some text' /></div></div></div>{/modalcontent}</div>

That is the syntax of Nonumber Modals. Classes of the main div need for sort the images by jQuery on page without reloading the page. So, I want all the images to be loaded. Maybe, I should better make some jQuery code to open the images in modal window myself? Nonumber make the DOM structure immediately. Then each image loading to cache (?). Now it is 117 requests|38mb transferred|Finish: 7.27s|DOMContentLoaded: 1,46s|Load: 7.27s.
http://www.studio116.ru/index.php/galereya


Now it is about fifty images and I planned to add much more, but I'm not sure now.
I increased the maximums for time and size of php requests on my server. And errors don't appear yet, but when it will be a thousand divs?
GreyHead 12 Jan, 2016
1 Likes
Hi efimleonid,

I suggest that you re-think how you are managing the images - 38Mb is a lot to pull out of the database and send to the browser. And it probably won't be cached in the browser (I'm not sure about this) so will be re-loaded on each page refresh.

Bob
This topic is locked and no more replies can be posted.