Not logged in. · Lost password · Register
Forum: General Help and Support Installation and Configuration RSS
Poor Image Performance
Avatar
kped1 #1
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
Subject: Poor Image Performance
Hi
I'm quite new to Dokuwiki and ran into a strange problem.
Generally, pages are rendered sufficiently fast.
When pages contain images, things change dramatically.
The whole page is loaded in an instant and after that the images show up one by one (about 2 per second). Tried with only a few small images (10 of ~10kb) and with thousands.
The performance is the same when opening the page directly on the server and is independent from the template used.
While the page is loaded, the webserver is at high CPU load.

The search in the forum did not bring me further. Don't know if caching is a problem.

Has anyone got an idea how to solve the problem or at least a hint where to search first?

Thank you!
Avatar
pop #2
Member since Nov 2016 · 161 posts
Group memberships: Members
Show profile · Link to this post
In my particular wiki, loading the pictures takes a long time, too, but only the first time a picture is shown at a particular size. Once that picture has been shown at that size, loading it again will be reasonably fast.

It appears that the rescaling of the pictures takes much time.
Avatar
andi (Administrator) #3
User title: splitbrain
Member since May 2006 · 3450 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
In reply to post #1
Quote by kped1:
Has anyone got an idea how to solve the problem or at least a hint where to search first?

Check that image resizing actually works (sounds like it isn't and all images are downloaded in possibly large resolution).

Check if the gdlib PHP extension is installed and enabled.

Consider switching to imagemagick for image resizing as it is usually more efficient.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
kped1 #4
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
Thank you for the quick replies.

@andi: Resizing was my first suspect. I did eliminate all resizing and still the same behaviour
@pop: There seems to be no caching on my page. After loading it serveral times the images are still loaded one after the other

To be more precise, this is the whole syntax of my test page:
====== Test ======
{{:a:b:d010001-20_10.jpg}}
{{:a:b:d010002-23_10.jpg}}
{{:a:b:d010003-28_10.jpg}}
{{:a:b:d010004-29_10.jpg}}
{{:a:b:d010006-48_10.jpg}}
{{:a:b:d010007-53_10.jpg}}

\\

The pictures themselves are 140KB (all together) and have all the same dimension.
Avatar
andi (Administrator) #5
User title: splitbrain
Member since May 2006 · 3450 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Can you post a Screenshot of chrome's network tab in the developer tools? would be helpful to have some numbers to see what is taking so long. especially the time to first byte for each of the images.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
kped1 #6
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
Hi Andi
see the attached file.
It is for a different page but the behaviour is of course the same
The author has attached one file to this post:
04.07.png 186.3 kBytes
You have no permission to open this file.
Avatar
andi (Administrator) #7
User title: splitbrain
Member since May 2006 · 3450 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Okay, that's interesting indeed. It takes nearly a second for the server to simply respond that the image has not been changed since last time. All that time is spent waiting for the answer. So the problem is at the server side. We need to know more about your setup:

  • what plugins do you have installed
  • what auth backend are you using
  • what kind of server hardware is this
  • what PHP version are you using
  • what webserver are you using
  • what OS is this on
  • is there some mechanism that might throttle requests (like some security or bandwidth management stuff)
  • whatever else might be different from other setups
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
kped1 #8
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
    what plugins do you have installed
ACL manager
authpdo plugin
Plain Auth Plugin
Backup Tool for DokuWiki
Blog
ckgedit
Data Tables Plugin
dropfiles plugin
Gallery Plugin
Image Map Plugin
include plugin
Info Plugin
Move plugin
multiorphan plugin
nspages plugin
Popularity Feedback Plugin
Revert Manager
safefnrecode plugin
smtp plugin
styling plugin
templatepagename plugin
User Manager
Video Sharing Site Plugin
Wrap Plugin

Template: bootstrap3 (but same behaviour with stock template)

what auth backend are you using
useacl = false
authtype = authplain

what kind of server hardware is this
4 Cores, 12GB RAM

what PHP version are you using
7.3.5
what webserver are you using
Apache 2.4.39
what OS is this on
Virtual Windows Server 2012 R2,
is there some mechanism that might throttle requests (like some security or bandwidth management stuff)
I don't think so. If this would be the case then serving large pages would cause some other process to get busy. In fact only apache runs on high CPU when serving requests. High CPU in this case means that on page request leads to about 25% of CPU usage which is one core busy. Two simultaneous requests double it and so on
    whatever else might be different from other setups
I don't think there is something special in our setup.
The only thing is that we're using some DIRECTORY and ALIAS Directives in our httpd.conf, but they are not touched by the pages under investigation
This post was edited on 2019-07-04, 11:02 by kped1.
Avatar
kped1 #9
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
After a few more tests I'm quite sure the problem has to do with dokuwiki.
When placing a single HTML-Page containing the same images from the same location on the server TTFB is always <100ms.

Is there a specific way dokuwiki loads images that could cause trouble? Some kind of auto resize e.g....
Avatar
andi (Administrator) #10
User title: splitbrain
Member since May 2006 · 3450 posts · Location: Berlin Germany
Group memberships: Administrators, Members
Show profile · Link to this post
I have to admit I'm puzzled by this. To dig into this further one would need to debug this on the server to try to see at which part the delay and high CPU is caused.
Read this if you don't get any useful answers.
Lies dies wenn du keine hilfreichen Antworten bekommst.
Avatar
kped1 #11
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
Meanwhile I have disabled all Plugins resulting in a slightly improved response time.
All plugins up: ~2200ms
All plugins down: ~1600ms

Still not acceptable and still with very high CPU load.

Any more suggestions?
Avatar
pop #12
Member since Nov 2016 · 161 posts
Group memberships: Members
Show profile · Link to this post
It's probably a silly suggestion, but when the intelligent ones are all tried, what remains are the silly ones.

I would check to see if the filesystem where the pictures reside have any remarkable properties such as compression or encryption which then would occupy the CPU just to render the stored data into a usable format.
Avatar
kped1 #13
Member for a month · 7 posts
Group memberships: Members
Show profile · Link to this post
Hi pop
thanks for the reply.

The file system should not be the problem. A simple HTML-Page loading the same images as on the Dokuwiki Page is >10 times faster.
Waiting time on Client side (TTFB) for an individual image is around 30ms compared to >500ms on dokuwiki.

I'd need some kind of debug information on the server side to get more details. Do you have an idea how to do that?
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-07-23, 00:49:41 (UTC +02:00)