Project

General

Profile

Actions

Bug #7985

closed

Commons lagging/disconnecting when uploading/inserting images

Added by Luke Waltzer about 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority name:
Normal
Assignee:
-
Category name:
-
Target version:
Start date:
2017-04-19
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

Noted on the TLC site (tlc.commons)... when uploading and then inserting an image, the post editor will lag and then I'll get a connection lost error. I'll reinsert the image, but the previous image will then show up as inserted.

I've seen this periodically before over the past six months.


Files


Related issues

Related to CUNY Academic Commons - Bug #7997: Transition from single cac-files.php file server to site-specific .htaccess directivesResolvedBoone Gorges2017-04-20

Actions
Has duplicate CUNY Academic Commons - Support #8602: Member not able to access Media tab on siteDuplicateBoone Gorges2017-08-28

Actions
Actions #1

Updated by Boone Gorges about 7 years ago

I just tested a bit, and found some lag in the process, but no errors.

Can you be a bit more specific about exactly where you're seeing the "connection lost" error? Is it after selecting the file for upload (Add Media, then Browse)? Or is it after clicking Insert Into Post? Are you seeing the "connection lost" error in your browser console, or is your main browser window showing an error?

Actions #2

Updated by Luke Waltzer about 7 years ago

Just recreated it on https://tlc.commons.gc.cuny.edu/?p=1793&preview=true

- Lag rendering thumbnails in the media uploader
- then when trying to insert image to post, I get error noted in attached screenshot.

The image eventually appeared (got call, don't know how long it took)

Actions #3

Updated by Boone Gorges about 7 years ago

Thanks for the additional details, Luke. I'm still unable to reproduce exactly, but I do see some lag and some other odd behavior.

We've been seeing some odd tickets this morning that all point toward some changed server configs. I'm going to reach out to IT.

Actions #4

Updated by Raymond Hoh about 7 years ago

TLC has the Anthologize plugin activated.

The issue might be related to Anthologize using a PHP session and the session perhaps not being closed.

The following article about PHP sessions and WordPress explains the problem (read the "Exclusive Locks" section):
https://pressjitsu.com/blog/wordpress-sessions-performance/

I experienced similar problems with long-hanging AJAX requests and PHP sessions with the WP Ajaxify Comments plugin.

I did the following to fix the problem in RBE:
https://github.com/r-a-y/bp-reply-by-email/commit/e6828ce6cab07f8fdbdfa8497a79ce497cd918a9

But, we could probably use a more, general fix on the Commons.

Actions #5

Updated by Raymond Hoh about 7 years ago

Luke, I've added a hotfix to the Commons. Can you check and see if uploads are more reactive on TLC now?

Boone, this is what I added:

add_action( 'admin_init', function()  {
    if ( defined( 'DOING_AJAX' ) && true === DOING_AJAX && session_id() ) {
        session_write_close();
    }
}, 999 );
Actions #6

Updated by Luke Waltzer about 7 years ago

Sorry guys, just saw these updates. Deactivated Anthologize. Site is running pretty slow, and just uploaded an image to the media library... took over a minute for all the thumbnails to load. Was able to select the image without the disconnection. however.

Actions #7

Updated by Luke Waltzer almost 7 years ago

Ran into this issue again while laying out this post: https://jitpstaging.commons.gc.cuny.edu/wp-admin/post.php?post=4117&action=edit.

Screenshot of connection lost error attached.

Report also came in that laying out a JITP staging post with more than a dozen images took an excruciatingly long amount of time.

Actions #8

Updated by Boone Gorges almost 7 years ago

  • Related to Bug #7997: Transition from single cac-files.php file server to site-specific .htaccess directives added
Actions #9

Updated by Boone Gorges almost 7 years ago

See #7997. Let's try to work on that issue this summer, as I think it's the source of much of the mentioned slowness.

Actions #10

Updated by Boone Gorges over 6 years ago

  • Has duplicate Support #8602: Member not able to access Media tab on site added
Actions #11

Updated by Boone Gorges over 6 years ago

  • Status changed from New to Reporter Feedback

Luke - I worked on this issue this morning and have a status update https://redmine.gc.cuny.edu/issues/7997#note-8 - When you've got a minute, would you please do a bit of testing to see if the performance problem is improved for tlc and other affected sites? If so, perhaps we can close this ticket and continue more general discussion in #7997.

Actions #12

Updated by Boone Gorges over 6 years ago

  • Status changed from Reporter Feedback to Resolved
  • Target version set to Not tracked

In the interest of clearing out the triage pile, I'm going to close this ticket. Luke, if you continue to experience problems (on non-private sites), please let me know. Thank you!

Actions

Also available in: Atom PDF