March 3rd, 2009

Performance issue in memcache userpic handling

Passing this on, first spotted by exor674 on Dreamwidth, who says:
I think I should report this bug I came upon while looking at the code however it causes no user-facing issues.
This bug is not causing any visible issues but is potentially a performance issue.

http://code.livejournal.org/trac/livejournal/browser/trunk/cgi-bin/ljuserpics.pl lines 302 through 346

On allpics.bml page and /data/userpics, those pages will always hit the database and never use memcache.
The picture URL field is seemingly never used,and when there are no URLs the value in the memcache key upicurl:$userid will be '', which is false, so the database will always be hit.

This will also happen for any user (without comments on *any* of their userpics) that has an entry or comment on an S2-styled page.
No comments on any userpic will make the upiccom:$userid value be '', and will cause the database to always get hit.

The code should use if ( defined( $comminfo ) ) on 309
and if ( defined ( $urlinfo ) ) on 331

Thank you.
Patch available at http://www.pastey.net/109369-3ctc for however long that service keeps pastes. Batteries not included. Content may settle during shipment. Keep out of reach of children. Not responsible for any damage. Some assembly required. Etc.
quietinfinity

Alternate ports and cookies

Hey everyone!
Cookies seem to be rejected on ports other then 80.
I have it up and running however I am getting the loopback to home page error on login.

Is it posible to use LJ on a port other then 80, for example 8080?
If so what are the correct settings for $COOKIE_DOMAIN? Or do I need to change something else entirely? I have tried ".hostname.com" and ".hostname.com:8080"


Well the above is fixed. however most of the site still does not work, especialy when logged in. Journal pages return the "sorry we are working on something" message. And I get the following two errors across the site.

[Error: unknown class 'betafeatures' at /home/lj/cgi-bin/ljcapabilities.pl line 65. @ livejournal]
and
[Error: Can't locate object method "is_sup_enabled" via package "LJ::SUP" (perhaps you forgot to load "LJ::SUP"?) at /home/lj/cgi-bin/weblib.pl line 2067. @ livejournal]


Thanks!