keainanhai ([info]keainanhai) wrote in [info]lj_dev,
@ 2008-10-20 12:06:00
Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Entry tags:server, server: config

Friends Entries Scroll Back
Greetings,

Recently one of my users submitted a support ticket wondering why they could only scroll back to entries no later then October 6. I checked it out and indeed they were right. So I tried changing some configuration options like:

$MAX_SCROLLBACK_LASTN = 400;

to something larger, but nothing seems to work. Then I checked on LiveJournal and oddly enough I can only scroll back to entries on October 6th and nothing more?

Am I missing something, what's going on here? Is this normal, and what can I do so people can go back further?!

Thanks!



(Post a new comment)


[info]pauamma
2008-10-20 05:53 pm UTC (link)
You want to set $LJ::MAX_FRIENDS_VIEW_AGE in etc/ljconfig.pl (in seconds, default is 14 days). See get_friend_items in cgi-bin/ljlib.pl for details.

(Reply to this) (Thread)


[info]keainanhai
2008-10-20 06:21 pm UTC (link)
Sweet, I believe I set it to run back 10 years. 3600*24*520. Haha is there a downside?

Why was this implemented? Is it new(within the last 4-5 months)?

Thanks man, super helpful as usual!!

(Reply to this) (Parent)(Thread)


[info]iamo
2008-10-20 07:29 pm UTC (link)
In order to page the information, it needs to load up the last N posts for each user on your friends list and then merge them. Upping the limit will cause it to have to load more data in memory, and spike your memory usage for the process that handles the request.

(Reply to this) (Parent)


[info]pauamma
2008-10-20 08:48 pm UTC (link)
That should be 3600*24*7*520, if you want 10 years. (That may be a typo, but...)

The major downside is taking a huge database and web server CPU hit, depending on how much your users post. But you know your hardware and your load, and I don't, so it may not be a problem in practice.

And as far as I can tell, that code has always been there. (It's probably the most heavily hit code segment in the whole server, and its performance is critical, so it almost never gets touched.)

(Reply to this) (Parent)


[info]keainanhai
2008-10-20 06:21 pm UTC (link)
Oh crap, I forgot to add, do you know if you can you limit this in user caps, for example EA accounts can go back 10 years, free users can go back 1 yr, etc...?

(Reply to this) (Parent)(Thread)


[info]pauamma
2008-10-20 09:01 pm UTC (link)
Not with the code as-is, but that's a relatively easy change. Just change the line in get_friend_items that sets $max_age from $LJ::MAX_FRIENDS_VIEW_AGE and use whichever limit you want for each account type. (You could also add a KV pair to the $opts hashref and have the caller do what's needed.)

(Reply to this) (Parent)


[info]snakeling
2008-10-20 05:54 pm UTC (link)
AFAIK, you can scroll back around a thousand entries (on LJ) OR two weeks, whichever comes first. So no entries beyond Oct 6. No idea whether you can change that setting, though.

(Reply to this) (Thread)


[info]keainanhai
2008-10-20 06:21 pm UTC (link)
Yeah, thanks :D I wonder when this was changed...

(Reply to this) (Parent)


[info]ursamajor
2008-10-20 05:57 pm UTC (link)
IANADev, but LJ's settings on the friends page restrict you to viewing "up to 1000 of the entries posted in the last two weeks.." So tomorrow, when you check, you'll only be able to see entries back to October 7.

(Reply to this) (Thread)


[info]keainanhai
2008-10-20 06:23 pm UTC (link)
Hrmm according to that FAQ it was updated back in 2007 so I guess this has been in the code for awhile, I just never noticed it heh.

Thanks!!

(Reply to this) (Parent)(Thread)


[info]ursamajor
2008-10-20 09:33 pm UTC (link)
*grin* It's been in the code since at least 2000, when I joined.

(Reply to this) (Parent)


Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…