WeBWorK Main Forum

Problems with png images very slow to load

Problems with png images very slow to load

by Jack Dockery -
Number of replies: 5
Just today, any problem that loads a png is very slow to load over 45 seconds. This is independent of the course. The server doesn't seem to be over worked at all. Is there something with mysql that should be cleaned out every few years?
We do see many soft links in wwtmp/coursename/images ... on the order of 10,000 per course going back a few years. 
In reply to Jack Dockery

Re: Problems with png images very slow to load

by Jack Dockery -
The only images that load slowly are static ones. If a png is generated in a problem, the problem loads in a reasonable amount of time. The problems 
with a static image are the ones that are slow to generate. They put a soft link in
wwtmp/course/images/ to the png file. Once the link is there load the image is
fine for you can copy the link into the web browser and it loads just fine. I think the slow down is generating the link, is this possible 

Any help would be great

In reply to Jack Dockery

Re: Problems with png images very slow to load

by Robert Mařík -

Go the same issue today. Fresh install of Debian 11 and WeBWorK 2.16.

But the softlink is created almost immediately. There must be some other delay.

Robert

In reply to Robert Mařík

Re: Problems with png images very slow to load

by Robert Mařík -
It has probably something to do with the following line from site.conf

$externalPrograms{checkurl} = "/usr/bin/lwp-request -d -t 40 -mHEAD";

With this line the delay is slightly more than 40 secs. Changing the number in the site.conf file changes the time delay accordingly.
However browsing the source code I was not able to find the purpose of this command.
Replacing the line with 

$externalPrograms{checkurl} = "";

works like a charm, but not sure about some other consequences.
In reply to Robert Mařík

Re: Problems with png images very slow to load

by Glenn Rice -

The only place this is used is in pg/lib/PGAlias.pm.  It seems that the actual result of this call is really quite meaningless as well.  That file is a total mess and needs to be reviewed and rewritten.

On the upside, setting $externalPrograms{checkurl} to the empty string will probably cause things to speed up, and there should be no problems with doing so.   That needs to be removed from the code.