WeBWorK Main Forum

Admin tool navigation significantly slower on 2.19

Admin tool navigation significantly slower on 2.19

by Sean Fitzpatrick -
Number of replies: 6

I've been noticing that my WeBWorK server feels a lot less responsive with 2.19 than previous versions.

Homework questions and answer checking seem fine, so the student experience should be OK.

But (for example) in the Sets Manager, if I click on the number of problems for a homework set (under the Problems) column, there's initially no response to the click, and it takes 5 seconds or more before the Set Detail page begins to load. Server side I don't see any issues with system resources -- memory, CPU, and load all seem normal.

Has anyone else encountered similar issues?

In reply to Sean Fitzpatrick

Re: Admin tool navigation significantly slower on 2.19

by Danny Glin -

Do you see anything in your browser's error console?

In reply to Danny Glin

Re: Admin tool navigation significantly slower on 2.19

by Sean Fitzpatrick -

The console is clean. The only thing I can find is an issue: "A form field element should have an id or name attribute".

It seems to be only the set detail pages that are slow to load. Everything else is fine.

In reply to Sean Fitzpatrick

Re: Admin tool navigation significantly slower on 2.19

by Danny Glin -

I don't see any delays when loading a set detail page.  Are there a large number of problems in your set?

Does this happen in a fresh course (i.e. one that was newly created and didn't have anything imported from old courses)?

In reply to Danny Glin

Re: Admin tool navigation significantly slower on 2.19

by Sean Fitzpatrick -

In my case, this is a course that was created from an archive of the same course last year, but all the problem sets are new.

Each one has about 12 problems, and there are so far no students enrolled.

If it's just me, I can live with it! I can't see anything I might be doing differently.

In reply to Sean Fitzpatrick

Re: Admin tool navigation significantly slower on 2.19

by Nathan Wallach -

I have also seen the "Set Details" page as loading very slowly, and may have found a cause and a workaround.

After some research, I suspect the problem is a fix made to the code which searches for possible problem header files to display as choices on this page. The corrected code now will search under all symbolic links in the course template directory, unless the links are included in $courseFiles{problibs} (which by default only includes Library, Contrib, and capaLibrary). In the past, it seems that the search would not actually search under symbolic links. In my case, I had relatively large local problem collections available via symbolic links. Delays in this search could also occur if there is any large directory tree under the course templates directory.

In my case, I seem to have gotten a significant improvement in performance of the Problem Set Details page by adding the two additional symbolic links being used in my courses to $courseFiles{problibs} by setting a local value for this in localOverrides.conf. It can also be done in course.conf for a specific course.

However, a quick hack to see if the search for header files is the cause of the slow loading of the Set Details page would be to edit lib/WeBWorK/Utils/Files.pm (under webwork2) and temporarily modify listFilesRecursive so that right after it defined @matches it would just return 

        return @matches;

so that no search will be run and then restart the server.

According to the commit message in GitHub a quick search, the listFilesRecursive routine is only be used for this specific search, so it should not break any other functionality while you are testing it.

https://github.com/openwebwork/webwork2/commit/567b80822165d1956a9260e06cdf73a0a0de1afe

In reply to Nathan Wallach

Re: Admin tool navigation significantly slower on 2.19

by Glenn Rice -
I wouldn't really call what you are doing a work around as it is not a bug. It is intended behavior. Using problibs is just what you should do for local libraries that are linked to in your courses templates directories.

I don't see why you would use your hack to check for a slow down. If you have a symbolic link that has a large number of files and directories in it, then that is certainly the reason for the slow down. Recursively searching a directory takes time if it has a lot in it. So in that case, just add it to to problibs so it is skipped when searching for header files.

Also note that this is not specific to symbolic links. If you have a subdirectory of your templates directory that has a large number of subdirectories and files in it, then you can also add it to problibs to skip it in the search.