Php photo gallery TWG | JFUploader | TWG Flash upload | WFU | Forum

Get help for TinyWebGallery, the best image gallery. The forum is also home for the Joomla JFUploader, TWG Flash Uploader and the Wordpress flash uploader.
It is currently 28. Nov 2024, 09:20

This forum is readonly now. Please use the new forum if you don't find the answer to your question here. The new forum is at https://www.tinywebgallery.com/blog/forum/


All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: 14. Jan 2008, 19:12 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
I convinced them to re-allow image.php, and they've said that as soon as they did, the load spiked again, but the interesting thing, is that they said the load spiked with requests to the cache, causing me to believe the problem truly lies with the number of images I have allowed in the index, which I believe is set to 20.

I'm thinking now that this may be the true source of the problem, as each page load by the browser would then send 20 requests to image.php, which could potentially add up quickly.


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 19:26 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
A call to image.php is completly different to a call of the cache.

image.php: the php compiler has to be started and the php files processed.
cache: The file is loaded by the webserver. Normally this is cached and very fast!

The interesting requests would the one when they allow image.php again. Because as you see on your site the gallery is almost running without it (use html mode and then even the detail pages work!).

And 20 images is of course some traffic but as you see in the speed of the gallery this is no problem at all.

But this are 20 calls to the cache - not 20 calls to image.php.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 19:37 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
This was their response

Quote:
Hello,
Cached images should, in theory, use fewer resources than continually
generated ones. Currently, out of the top 5 requested sites on the
server now, your site has more than the other 4 combined. Either the
script for rule 34 will need to be disabled or removed altogether.


I requested to be able to modify it before removal, but if I can't fix it, I'm relucantly going to have to find another gallery system. Which is a shame, because I really did like this interface.


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 19:56 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
I had another thought, the folder with the bulk of the content in it named "galleries"

Code:
#removed_broken_linkpictures/1_Rule%2034_br54923267370104/3_Galleries/


upon loading that page within the gallery, which it's almost assured that every load would be, since it is a random image each time, across 187 folders? As I add more folders to this list, more and more times as it's loaded, it each time loads a random image.

Would disabling this, or using a folder.png be a high speed up option?


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 20:17 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
sure - random needs a lot of calculations because the whole folder is read. But only once a session.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 20:47 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
I really don't think it's read once a session. While still on the same session, if I reload that page, it will load a new random image each pageload, at least I thought so in any case.

What I'm trying right now is to decrease the load time off the "gallery" section by decreasing the number of galleries shown per load. I set it enourmously high, to over 600, so that all the galleries could be shown on one page, and I've decreased that number to 6 x 3, 18.

I've also reduced the dhtml menu from 40 & 20 in ie and ff, to 10 each.

Hopefully this should be enough.


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 21:02 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
600 is a killer ;).

random image only loads the directory once. I get a new random image from an internal session cache because the random function is picking a random image from the images not used for random.

But as I say - you see how seldom image.php is used because the gallery is almost running without. Use the html mode - then image.php is not needed because ajax is not used.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 21:35 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
but I like the dhtml mode :wink:

With the settings as I have them arranged now, I was told I got the server load to very low, but he also said this, to which I don't have an answer to.

Quote:
I just checked the load and while it's very low, the number of Apache
connections is simply through the roof:

[root ~]# scores
Top Host : rule34.of-the-intern
Top 5 Reqs :
2041 rule34.of-the-intern

Luckily it's not bringing down the server or Apache but it's odd for
the script(s) to be using such a huge number of connections at once.


Do you know why apache connections are so high?


Top
 Profile  
 
 Post subject:
PostPosted: 14. Jan 2008, 21:46 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
Each image is one connection. You do the math.

e.g. loading the main page of my demo is 74 requests.
And that are 55 images only. a couple of stylesheets and a couple of Javascripts - That's it.

Therfore it's completly normal for an image gallery.

You can save some images by removing some language flags (not all 23 are really needed)

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 15. Jan 2008, 00:35 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
The guy asked why exactly each image needed it's own connection.

He showed me the top 5 apache connections,
I'm in the lead with 2041,
and the guy in second place has 2,
and third place had 1.

Quote:
Please get in touch with
your developer and inquire why each image in the gallery needs its own
apache connection. This does is not normal behavior for the galleries I
have worked with.


The guy's kinda weirded out by the high numbers.


Top
 Profile  
 
 Post subject:
PostPosted: 15. Jan 2008, 10:10 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
This has nothing to do with the gallery.
This is server configuration thing:

http://linuxgazette.net/123/vishnu.html

Code:
3.8 KeepAlive and KeepAliveTimeout:

The KeepAlive directive allows multiple requests to be sent over the same TCP connection. This is particularly useful while serving HTML pages with lot of images. If KeepAlive is set to Off, then for each images, a separate TCP connection has to be made. Overhead due to establishing TCP connection can be eliminated by turning On KeepAlive.


If they configure their server right then one connection is used for several images

I only have <img> tags to get the images. This is normal html standard

But having 600 images on one page is not the problem of the gallery itself - this is a configuration thing.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 15. Jan 2008, 10:40 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I'm currently optimizing request as last step for 1.7.
There i'll merge e.g. small css and js files that they are only loaded once.

But this will maybe be 5 or 6 requests less.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 15. Jan 2008, 19:09 
Offline

Joined: 27. Jul 2007, 20:28
Posts: 136
Hey, they got that information you posted and said that there are several hundred connections that seem to never terminate:

Quote:
Hello,
They are still quite high:
Code:
[root ~]# date && scores|grep rule34
Tue Jan 15 10:31:59 CST 2008
Top Host   : rule34.of-the-intern
   2018 rule34.of-the-intern
[root ~]#

2018 connections at that exact second. However, again the load is
quite low:
Code:
[root ~]# uptime
 10:32:44 up 3 days, 17:33,  2 users,  load average: 1.31, 1.49, 1.54
[root ~]#

From looking at `scoreboard` (a live real-time read-out of what Apache
is actually processing at any given second), all of the connections are
to the /cache/ directory but almost all of the connections are staying
open and never closing properly, I saw one Apache connection that had
been open for 952 seconds. I just restarted Apache itself and the
connections went from zero to 277 in a matter of a single minute.


Top
 Profile  
 
 Post subject:
PostPosted: 16. Jan 2008, 00:56 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
I don't understand this because all connections to the cache are images.

and this looks e.g. like this:
<img src="./cache/01_Administration_Upload%2B-%2BTWG%2BUpload%2BFlash.gif.thumb.jpg" height="120" width="120">

And this is a normal image tag.

I cannot close anything here.

I have found something in the Ajax connections that can be closed.
I can send you this file and you can try.

/Michael


Top
 Profile  
 
 Post subject:
PostPosted: 21. Jan 2008, 01:07 
Offline
Site Admin
User avatar

Joined: 1. Aug 2005, 12:53
Posts: 11232
can they tell me how a request exaclty looks like?

I have checked the Ajax implementation and there a new connection is made for every request. I'm currently changing this that a connection is reused.
But this connections all go to image.php - not to the cache folder.

/Michael


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
cron
powered by phpbb | Datenschutz/ Privacy policy