Loading...

Top
PFQ Banner

This is PokéFarm Q, a free online Pokémon collectables game.

Already a user? New to PFQ?

Server performance and desyncs

Forum Index > Core > Announcements > News Archive >

Pages: 123··· 91011

Niet [Adam]'s AvatarNiet [Adam]
Niet [Adam]'s Avatar
As I'm sure you've noticed, if you've tried playing PFQ around Reset, it's... laggy. Here's what I'm currently doing to try and fix it.
Update(s) at end of post The underlying cause is, of course, "my ten-year-old code was never designed to handle this." But short of rewriting the whole thing, I can make some tweaks to squeeze some performance out of things. The database is definitely the biggest bottleneck right now. The major lag spikes occur when, for whatever reason, the "sessions" table falls out of active cache. When this happens, every single user gets lag because their requests to the server are trying to query the "sessions" table for authentication and updating online status. Imagine a door that's supposed to stay open, but closes for some reason as thousands of people are trying to get through it at once... Even when the door opens again, it's a mess for some time afterwards. That's the kind of thing going on here. To address this, configuration settings are being tweaked, that should hopefully increase the "open table cache" and either prevent this issue outright, or at least significantly reduce its impact. A consequence of the database "misbehaving" is that this leads to desyncing of data between it and the server's Memcache. I've been using Memcache to store copies of data in memory rather than having to query the database for them. However, this can lead to issues if the Memcache and database disagree on what the value should be. In the best case, things will just look a bit weird for a while. Most commonly, Pokémon may be "stuck" in a Scour mission that they aren't actually on, for instance. But in the worst case, if you buy ZC and it gets desynced, and then you do something else with ZC, the desynced value would then be saved back to the database. Thankfully I can fix ZC in particular, but it's not good! To try and reduce the impact of this, I have changed the default time that Memcached holds on to data, reducing it from one hour all the way down to one minute. The downside is that the database may need to be queried more often for the data, the upside is that any desyncs will fix themselves in a minute rather than an hour! I'm going to run the game like this for a while, maybe a few days, and see what impact this has on the game's performance. Hopefully, it won't affect much, and we'll just get the benefits of "less desync." We'll see!
Update Feb 27th A number of factors have been successfully identified as contributing to lag. • Pokémon Platform images each caused the full session handler to load. This is almost certainly a major culprit in why the session table was getting so hammered. • Additionally, forum posts with very large numbers of images would cause an excessive number of connections to the server. In the near future I will be implementing "limit per post" limits on certain BBCodes to reduce lag caused by "expensive" codes. This will probably be around 50 for [img] but we'll see what works. This will affect Journals that have "Live Dexes" - I'm very sorry but these were causing unmanageable amounts of lag... Please consider breaking down your Live Dex posts into smaller pieces, or instead just using your Fields to present such a Live Dex. On further consideration, I can do something better than just nuking forum posts. I will investigate better options. • 42 accounts have been locked for (strongly) suspected botting. Update: Thankfully, the vast majority of these were not as strong as previously thought. The mod team is working on resolving the affected users' tickets and most should be unlocked very soon. The underlying cause was a combination of server lag and some QoL/CSS codes making certain activity look very suspicious. The UI has been updated to alleviate this issue, but in general please try to avoid hammering the server. If it doesn't load the first time, clicking again isn't gonna make it load any faster! If you know someone who was locked, encourage them to send a ticket to the Support Centre for discussion. This thread is not the location to discuss locks, especially locks that are not your own (doing so is in violation of Site Rule 2H). • It was possible to create shortlinks of shortlinks. We heard you like shortlinks, but it was a bit silly to have a system potentially enter an endless loop of redirects. This has been patched. I will be continuing to monitor the health of the game going forward, and will report back if there are any further updates to this situation. Thank you for your continued patience as we deal with this!
I forgot to mention possibly the biggest adjustment: The Shelter updates its contents every 15 minutes, including at 00:04. This is right after the Shelter "opens" for the day at 00:02, causing a lot of people to be trying to use the Shelter while it performs its first update of the day. To address this, I have hopefully simplified the Shelter update code, and also temporarily the Shelter will remain closed until 00:10. I will be looking to bring this back to opening as early as possible, but for now this should give the script plenty of time to run. Also, the Shelter page will be much more forward with its "Shelter is closed for Reset" text. Further adjustments made today: • The "Clickback" and "Open 10" links will now disable themselves and show a "Loading..." text when clicked. This will prevent issues involving certain QoL/CSS codes that pull it in to your "no mouse move clicking" script area, as no matter how many times you click them, it will only cause one load. • Images on the forum have had the loading="lazy" attribute added to them. This instructs the browser to only load them when they become visible on screen rather than all at once. This doesn't always play nice with Accordions when they are opened for the first time (because the images haven't been loaded yet, it can't animate to the correct height) but this is fairly minor and "fixes itself" after the initial loading. This should also cut down on the high volume of image requests mentioned earlier in this post.
Clip from Pokémon anime, re-lined by me
-- OMNOMNOM!
Featured story: Injustice Feedback welcome!
Arcite's AvatarArcite
Arcite's Avatar
Funny enough, I was just chatting with someone about whether this was a database issue and whether you'd address it haha. Amazing timing, thanks! Hope to see improvement.
[Avatar by Cryst. Character design by Hime.] [Formerly KikiLink, please call me Arcite or Seiya.]
Kyubiisaan's AvatarKyubiisaan
Kyubiisaan's Avatar
Idk if this comparison has ever been made before, but PFQ's development reminds me of Team Fortress 2's. Incredibly long development time (not in a bad way it just means more active support and features), and everything is kinda built on top of itself, so a change to one thing changes everything. It's incredibly tough to properly fix something like that so you have my respect. Is this a helpful metaphor? I'm generally trying to understand the state of the game, I don't know much about programming haha
"It is our duty to fight for our freedom. It is our duty to win. We must love each other and support each other. We have nothing to lose but our chains." - Assata Shakur
Raziya's AvatarRaziya
Raziya's Avatar
Thanks for this, Niet! I honestly just figured it was because everyone was online doing stuff at the same time and it just made the servers sleepy 😅
Score: 0
team poison march 2024 trophy by teaspoonsoup!
Niet [Adam]'s AvatarNiet [Adam]
Niet [Adam]'s Avatar

QUOTE originally posted by Kyubiisaan

Idk if this comparison has ever been made before, but PFQ's development reminds me of TF2.
Today's update: fixed a server crash when Sally tries to eat her own gun. Honestly? Yeah. Very good comparison XD PFQ is held together with duct tape, but it's still doing remarkably well for it!
BigBadBowser's AvatarBigBadBowser
BigBadBowser's Avatar
Thanks for the update! I had a feeling it was something like this and usually hop off near reset if I can help it lol. Hope you can get things sorted out =)
Score: 0
Original by LycanKai, new by NassiLove, icon by Pokefarm
-Favored Natures: Any/Sour! (Quirky Perferred!) -Always Looking for Spars! -Do not offer me anything unless you are going to follow through! -Forum Avatar is Bowser's official victory pose from Super Mario RPG!
teefa85's Avatarteefa85
teefa85's Avatar
Yeah, I noticed when I was swapping out some newly hatched 'mons after getting the last hatch of a Z-Crystal in order to put in a few other things to level. Thanks for keeping an eye on things. And hope Sally doesn't eat the new wiring and cause you even more work.
Screenshot taken from Trials of Mana using my own Switch.
Korvaa's AvatarKorvaa
Korvaa's Avatar
not gonna lie, yeah sometimes its mildly annoying. But its to be expected of a game with lots of people on at one time. Yeah, mildly annoying, but what good game that lags doesnt bother you on some level? I have to see the good side. It means people are playing, and enjoying the game. It just goes to show that the game is fun and people like it. I also want to say thank you for addressing it. I know you don't have to say anything, honestly, and could have been working on it in the background and just, well, not addressed it. So thanks for explaining.
Score: 0
Ladystar90's AvatarLadystar90
Ladystar90's Avatar
i kinda find this ironic we get deinoglitch back and things are glitching out maybe someine needs to talk to the baby hatchlings. lol in all seriousness though thank you niet for letting us all know what is going on and keeping us up dated and doing the best you can in your capable hands :)
Type Race Score: 0
Noahverse's AvatarNoahverse
Noahverse's Avatar
I've only been on here for a little over a month, and I want to say, thanks for being so proactive with fixing issues and the transparency. Imo it helps the game feel more like a community, because everyone one just wants what's best for this game <3

Noah | he/they | AuDHD


: 0 pts!
Journal (F2U codes) credits

credits

Code @RAINB0W Forum Icon F2U @MellowKun on Deviantart Divider F2U @hedgehominoid on Deviantart Signature Pagedoll F2U @SquishDemon on Deviantart Shop logo commissionned from Lilieth for my shop
I collect fairy Deltas!
^ My Trade Shop! ^

Pages: 123··· 91011

Cannot post: Please log in to post

© PokéFarm 2009-2024 (Full details)Contact | Rules | Privacy | Reviews 4.6★Get shortlink for this page