[wp-trac] [WordPress Trac] #34560: Server error after saving many revisions
WordPress Trac
noreply at wordpress.org
Wed Nov 4 20:36:45 UTC 2015
#34560: Server error after saving many revisions
-------------------------------------------------+-------------------------
Reporter: pdfernhout | Owner:
Type: defect (bug) | adamsilverstein
Priority: normal | Status: assigned
Component: Editor | Milestone: Future
Severity: major | Release
Keywords: needs-unit-tests has-patch dev- | Version: 3.6
feedback needs-testing | Resolution:
| Focuses:
-------------------------------------------------+-------------------------
Comment (by pdfernhout):
Replying to [comment:14 adamsilverstein]:
> Thanks for the extensive testing!
You're welcome. Thanks again for making these improvements.
> I did already address excessive memory use in the revisions list,
removing the content from the retrieved values was a big part of the
memory gains, I think all the remaining fields are required.
Yes, the editor is much better now. I don't think removing more revision
metadata fields will make much of a difference in any case. But there seem
to probably be two revisions lists retrieved by the editor. The first one
was just to count them (which you improved). I'm guessing there is a
second one retrieved as well to display a list of revisions at the bottom
of the page and which may still be an issue? Hard to believe the editor
page was retrieving a list of all revisions of the post '''twice''' (or
maybe more), but that seems to be the case somehow, or at least, that is
the most obvious hypothesis that fits the facts.
> Are you seeing issues on the revisions interface screen? I have mainly
been testing on the post edit screen.
As reported, from incidental testing, I see unexpectedly high memory use
on the revisions screen with this big page. I would expect the revisions
screen should use the memory needed for the revisions list (<1MB by my
estimate) plus twice the biggest post (again < 1MB total in my test). So,
for my test situation, I would expect about 28MB to be used, not 89MB. So,
about 61MB of memory beyond the minimum possible needed seems to be used
on the revisions screen.
It looks like issue #25233 is related to this one in a similar way as
issue #24958 is. Again the difference is that the other issue is on the
revision list itself; specially how the "revisions metabox suffers from
performance degradation when ... a large amount of revisions (e.g. 600+)
is achieved on a post." That is the same thing I am seeing here, assuming
"revisions metabox" is referring to the one on the bottom of the editor
screen. And that issue also includes a comment from you referring to issue
#25123, on perhaps replacing the revisions metabox with a plugin. Although
other proposed solutions are to selectively load posts as needed for
comparison on the revisions screen.
Presumably, removing the revisions metabox list from the bottom of the
editor screen would indeed fix the rest of the memory use issue in the
editor for large numbers of big posts? Improving the revisions list to use
the new wp_get_post_revisions_details would also presumably address the
issue too.
So, the good news is, several related issues could be resolved eventually
by these improvements. However, the rest of you comment leaves me puzzled
that maybe the revisions list is not the issue?
> I discovered that even if I completely remove the code firing for the
revisions meta box, I still see large amounts of memory consumed on the
edit screen when the post contains many revisions; I'm going to try to dig
into the other queries to see whats going on. I've been using
@johnbillion's Query Monitor to view the memory usage.
That seems really odd. Life is full of surprises, some bad, some good. :-)
Some error_log() statements might quickly confirm what functionality is
being called, especially by putting one in the wp_get_post_revisions
function.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34560#comment:15>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list