Fix performance regression in v1.57

Bug #1802487 reported by Ricardo
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-memcache (Ubuntu)
Fix Released
Undecided
Unassigned
Bionic
Fix Released
High
James Page
Cosmic
Fix Released
High
James Page
Disco
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
Performance under Python 2 with this package since 1.54 is poor due to the lack of use of the native C implementation of pickle.

[Test Case]
run attached memcache-test.py under python 2.
with proposed fixes, should be approximately 2/3 of the execution time of the unpatched version.

[Regression Potential]
The picked fix is relatively minor and simply adjusts the import under Py2 to use the native C implementation so regression potential will be low.

[Original Bug Report]
Just migrated a python 2 application from 14.04 LTS to 18.04 LTS and got a serious performance degradation. Like 1000 times slower. After some profiling it was concluded that the problem was the transition from cPickle back to pickle for data serialization.

This is a problem fixed in version 1.58.
https://github.com/linsomniac/python-memcached/releases/tag/1.58

Please upgrade python-memcache to a more recent version or patch the current version.

Versions affected: Ubuntu 16.04 LTS and Ubuntu 18.04 LTS

Revision history for this message
James Page (james-page) wrote :

disco has 1.59; so marking dev task as Fix Released; however we can't just rev the version in Bionic and Cosmic, we'll need to pick a specific fix to minimise the regression risk.

Changed in python-memcache (Ubuntu Disco):
status: New → Fix Released
Revision history for this message
James Page (james-page) wrote :

Commit 781021ea5a5676662cfd1e7832b80372d93736df contains the fix for the py2 performance issue.

Changed in python-memcache (Ubuntu Cosmic):
status: New → Triaged
Changed in python-memcache (Ubuntu Bionic):
status: New → Triaged
importance: Undecided → High
Changed in python-memcache (Ubuntu Cosmic):
importance: Undecided → High
description: updated
Revision history for this message
James Page (james-page) wrote :
description: updated
description: updated
James Page (james-page)
Changed in python-memcache (Ubuntu Bionic):
assignee: nobody → James Page (james-page)
Changed in python-memcache (Ubuntu Cosmic):
assignee: nobody → James Page (james-page)
Changed in python-memcache (Ubuntu Bionic):
status: Triaged → In Progress
Changed in python-memcache (Ubuntu Cosmic):
status: Triaged → In Progress
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Ricardo, or anyone else affected,

Accepted python-memcache into cosmic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-memcache/1.57-2ubuntu0.18.10.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-cosmic to verification-done-cosmic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-cosmic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in python-memcache (Ubuntu Cosmic):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-cosmic
Changed in python-memcache (Ubuntu Bionic):
status: In Progress → Fix Committed
tags: added: verification-needed-bionic
Revision history for this message
Brian Murray (brian-murray) wrote :

Hello Ricardo, or anyone else affected,

Accepted python-memcache into bionic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/python-memcache/1.57-2ubuntu0.18.04.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-bionic to verification-done-bionic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-bionic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Revision history for this message
James Page (james-page) wrote :

bionic:

release pocket version

# time python memcache-test.py

real 0m21.069s
user 0m14.304s
sys 0m3.174s

-proposed version:

# time python memcache-test.py

real 0m13.247s
user 0m8.359s
sys 0m2.727s

cosmic:

release pocket:

# time python memcache-test.py

real 0m19.094s
user 0m13.056s
sys 0m3.161s

-proposed version

# time python memcache-test.py

real 0m13.996s
user 0m8.968s
sys 0m2.760s

tags: added: verification-done verification-done-bionic verification-done-cosmic
removed: verification-needed verification-needed-bionic verification-needed-cosmic
Revision history for this message
Brian Murray (brian-murray) wrote : Update Released

The verification of the Stable Release Update for python-memcache has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-memcache - 1.57-2ubuntu0.18.10.1

---------------
python-memcache (1.57-2ubuntu0.18.10.1) cosmic; urgency=medium

  * d/p/py2-perf.patch: Cherry pick fix to use native C implementation
    for pickle under Python 2, resolving issues with performance
    degradation (LP: #1802487).

 -- James Page <email address hidden> Thu, 22 Nov 2018 11:50:53 +0000

Changed in python-memcache (Ubuntu Cosmic):
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-memcache - 1.57-2ubuntu0.18.04.1

---------------
python-memcache (1.57-2ubuntu0.18.04.1) bionic; urgency=medium

  * d/p/py2-perf.patch: Cherry pick fix to use native C implementation
    for pickle under Python 2, resolving issues with performance
    degradation (LP: #1802487).

 -- James Page <email address hidden> Thu, 22 Nov 2018 11:50:53 +0000

Changed in python-memcache (Ubuntu Bionic):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.