• Login
  • Register
Hello There, Guest!

Username:

Password:

Remember me

Lost PW Lost Password?

Advanced Search
  • Rules
  • Staff
  • Wiki
  • Free Companies
  • Linkshells
  • Calendar
  • Chat
  • Gallery
  • Donate
home Hydaelyn Role-Players → Final Fantasy 14 → FFXIV News v
« Previous 1 … 6 7 8 9 10 … 22 Next »
→

Recent forum error pages


RPC has moved! These pages have been kept for historical purposes

Please be sure to visit https://ffxiv-roleplayers.com/ directly for the new page.

Recent forum error pages
Threaded Mode | Linear Mode

FreelanceWizardv
FreelanceWizard
Find all posts by this user
Visit this user's website
Random RPer #258
*****

Offline
Posts:2,319
Joined:Sep 2010
Character:L'yhta Mahre
Linkshell:Mysterium
Server:Balmung
Reputation: 317 Timezone:UTC-6
RE: Recent forum error pages |
#5
11-06-2014, 12:56 PM
Sure. Smile Gory technical details ahoy:

Basically, the post reputation system tries to compute the reputations of everyone it sees on a page, and it does this not by loading a counter from the database, but by pulling in the whole database table for reputation entries and running a computation on that. Since I loosened up the reputation system, this table has grown, and it was exceeding the APC (the opcode/data cache) shared memory limit. PHP's response to this was to throw a fatal error and crash with a segmentation fault (because in the world of PHP, any fatal error is a segmentation fault). It was seemingly random because the reputation code is called in a lot of different places, some rather unexpected, and you could actually stuff the table into APC if not a lot of other things had already been put in there (like, say, user sessions).

I was only able to work this out by tweaking the FastCGI process manager and nginx to try to capture those errors and the core dumps. The solution was to increase PHP's maximum memory and the size of the shared memory space for APC. Merely turning off APC wasn't sufficient (since the board was grabbing the table more than once and blowing itself up), nor was just turning up the maximum script memory.

Now, in terms of how I'd do it if I were writing the code, I'd do one of two things, depending on how my database server behaved. Keeping the reputation entries in a table is a fine idea, and if the DB server can do quick computations on query (as, say, MS SQL Server and Oracle can -- not that anything in Oracle is "quick" per se Smile ), I'd just have it do the aggregation and return a single number to me, something like:

select count(postrep.*) from users
inner join postrep on users.user_id = postrep.user_id
group by postrep.user_id
where postrep.user_id = @user

I could then kick that over to the server using ExecuteScalar or the equivalent and quickly get an answer back. For getting multiple reputation counts at once, I might instead put postrep.user_id in the select statement and filter the results in the script. LINQ, for instance, makes that super-easy, depending on whether you want to use the Join, Intersect, or Where operators.

For something like MySQL, where aggregations at the database aren't fast, or a NoSQL/in-memory store where you really can't do any aggregations, I'd create a field in the users table to hold the current post reputation count for each user and increment it whenever someone got a new reputation bump. Then, I'd just pull the reputation counts out of the user table.

Of course, this being MyBB, I can't really do it how I'd want to and still be able to upgrade the code, so I'm stuck with watching logs and debugging when weird stuff happens. Smile

The Freelance Wizard
Quality RP at low, low prices!
((about me | about L'yhta Mahre | L'yhta's desk | about Mysterium, the Ivory Tower: a heavy RP society of mages))
Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
Recent forum error pages - by FreelanceWizard - 11-04-2014, 09:17 PM
RE: Recent forum error pages - by FreelanceWizard - 11-06-2014, 12:23 PM
RE: Recent forum error pages - by Tiergan - 11-06-2014, 12:35 PM
RE: Recent forum error pages - by Unnamed Mercenary - 11-06-2014, 12:39 PM
RE: Recent forum error pages - by FreelanceWizard - 11-06-2014, 12:56 PM
RE: Recent forum error pages - by FreelanceWizard - 11-07-2014, 11:57 PM
RE: Recent forum error pages - by Blue - 12-06-2014, 05:39 PM
RE: Recent forum error pages - by FreelanceWizard - 12-06-2014, 07:18 PM
RE: Recent forum error pages - by Blue - 12-06-2014, 11:17 PM
RE: Recent forum error pages - by FreelanceWizard - 12-07-2014, 02:29 AM
RE: Recent forum error pages - by FreelanceWizard - 12-07-2014, 12:49 PM
RE: Recent forum error pages - by Blue - 12-11-2014, 01:48 AM
RE: Recent forum error pages - by Warren Castille - 12-11-2014, 04:20 PM
RE: Recent forum error pages - by Atoli - 12-11-2014, 04:25 PM
RE: Recent forum error pages - by FreelanceWizard - 12-11-2014, 04:58 PM
RE: Recent forum error pages - by Blue - 12-12-2014, 01:20 AM
RE: Recent forum error pages - by FreelanceWizard - 12-12-2014, 09:37 AM
RE: Recent forum error pages - by Blue - 12-12-2014, 09:58 AM
RE: Recent forum error pages - by Atoli - 01-01-2015, 12:58 AM
RE: Recent forum error pages - by FreelanceWizard - 01-01-2015, 01:20 AM
RE: Recent forum error pages - by Atoli - 01-01-2015, 02:19 AM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread


Users browsing this thread:
Index | Return to Top | Lite (Archive) Mode | RSS Syndication | Current time: 07-27-2025, 03:55 AM


Final Fantasy XIV images/content © Square-Enix, forum content © RPC.
The RPC is not affiliated with Square-Enix or any of its subsidiaries.
Powered By MyBB, © 2002-2025 MyBB Group.
Designed by Adrian/Reksio, modified by Kylin@RPC