Niantic Talk about Optimisation Throughout Raid Occasions & ‘Spiky QPS’

10 Min Read

With in-person occasions occurring increasingly ceaselessly, from Pokémon GO Fest, to Safari Zones, the Extremely Beast launches, and now the brand new Metropolis Safari occasions, one of many largest points folks fear about is how the sport will run easily. With extra folks in a single location that the sport can usually deal with, Niantic should provide you with new methods to maintain the sport working nicely, with out glitches. Add within the spoofer drawback that inevitably coms with sure kinds of in-person occasions, and the potential for catastrophe is extra current than ever.

So how do Niantic take care of that? They not too long ago shared a weblog publish titled ‘Optimizing Pokémon GO: How a Centralized Redis Cluster Improved Efficiency and Reliability Throughout Fashionable Raid Occasions' by Da Xing and Michael Mei discussing this drawback, and the way it particularly pertains to raiding at in-person occasions. They be aware that whereas lobbies for raids max out at 20 individuals, every gymnasium can host a whole bunch of lobbies concurrently.

Tackling Technical Hurdles Throughout Raids

“From a technical standpoint, the raid characteristic in Pokémon GO is engineered and deployed as a strictly in-memory characteristic. Consequently, all gamers who take part in the identical gymnasium are hosted on the identical server. Throughout particular raid occasions or in closely frequented raid areas, the server infrastructure faces vital technical hurdles as a result of sheer variety of gamers current.”

“One of many challenges of raid occasions is the sudden giant inflow of site visitors (aka spiky QPS). The sport operates in a multi-server atmosphere, with gamers often being evenly distributed throughout all servers. Nonetheless, throughout raids, gamers in the identical gymnasium must be on the identical server with the intention to entry the shared recreation knowledge saved solely within the reminiscence of the corresponding server, similar to participant profiles and raid metadata. This may result in unbalanced server masses, as well-liked raid areas entice extra gamers, leading to elevated site visitors to the servers internet hosting these gyms.”

Spiky QPS and Delays for Gamers

Big Pokémon GO Crowd at Chester Heritage Competition

“Throughout significantly well-liked raid occasions, the servers can develop into overwhelmed by excessive spiky queries, as hundreds of gamers could also be raiding below one gymnasium over a brief time frame. This may trigger vital delays for gamers in the identical raid, in addition to for individuals who usually are not within the raid however are on the identical server, ultimately rendering the sport unplayable for all affected gamers. To handle this challenge, Niantic website reliability engineers slowly drain out the affected server, quickly redirect gamers to different servers and restart the busy server.

Along with QPS-related challenges, the stateful nature of the system additionally makes scaling and restarting tough. The server shops in-game participant attributes in reminiscence, which restricts gamers to attach and stay on a selected server. Niantic has developed an efficient however sophisticated course of to make sure that gamers usually are not affected throughout scaling. Nonetheless, throughout main raid occasions when servers are clogged by spiky QPS, this course of might take longer to empty out gamers on scorching servers, which signifies that recreation purchasers is probably not responsive for a number of minutes till the recent server is restarted.”

Monitoring affect on CPU utilization as complete participant depend rises
Monitoring affect on CPU utilization as complete participant depend rises

Simplifying the Technical System

“One main change we made was to retailer the raid-related shared knowledge, beforehand saved within the reminiscence of the servers, within the centralized Redis cluster. This permits all Pokémon GO servers to entry the raid-related shared knowledge, eliminating the necessity for gamers to connect with the precise server the place the gymnasium is hosted to affix raid teams. This simplifies the technical system considerably.”

“With the raid-related shared knowledge saved within the Redis cluster, load is now extra evenly distributed. Gamers can hook up with any server, no matter the place the gymnasium is hosted, eliminating the unbalanced load brought on by well-liked raid gyms. This modification has eliminated the bottleneck and allowed the servers to maintain increased QPS throughout well-liked raid occasions.

The supplied diagram presents a heatmap visualizing the load distribution throughout all servers. The x-axis corresponds to time, whereas the y-axis represents the variety of gamers on every server. Every cell throughout the heatmap is color-coded to point the magnitude of server load. Particularly, a purple cell signifies {that a} vital variety of servers exhibit related participant counts, whereas a inexperienced cell signifies that just a few servers are accommodating a particular participant depend.”

The x-axis corresponds to time, whereas the y-axis represents the variety of gamers on every server

“Since we’ve slowly rolled out this Redis resolution beginning at roughly 11:30 am on that individual day, a noticeable change within the server panorama occurred. The prevalence of excessive participant depend servers, generally known as “hotspots,” decreased considerably. As a substitute, the vast majority of servers at the moment are internet hosting a comparatively constant participant depend ranging between 1.5k to 2.5k.”

“Notably, the utmost recorded latency has decreased from over 1 second to roughly 250 milliseconds (75% latency drop).”

Launching at a International Scale

“The introduction of the mission on a world scale, at roughly 4:00 pm, resulted in a big discount in latency. Latency represents the period it takes for a server to reply to a participant’s request, usually occurring when a participant interacts with the sport consumer. Notably, the utmost recorded latency has decreased from over 1 second to roughly 250 milliseconds (75% latency drop). This enchancment is visually represented within the chart supplied beneath.”

The utmost recorded latency has decreased from over 1 second to roughly 250 milliseconds

“Furthermore, the server is now extra dependable. Lengthy delays and server hiccups throughout well-liked raid occasions have been significantly decreased because the mission was launched into manufacturing and fine-tuned by way of just a few iterations. This offers a extra steady raiding expertise throughout main occasions and saves operational and upkeep prices that may be invested in different areas to enhance the general gaming expertise.

We're continually working to enhance the Pokémon GO participant expertise, and have already began growing an excellent higher resolution to additional improve the efficiency and reliability throughout well-liked raid occasions. We can be sharing extra particulars on this mission quickly, so keep tuned for extra. Joyful Raiding!”


Niantic don't typically share technical data and particulars like this with us, and it's a actually attention-grabbing learn! Tackling giant quantities of gamers at in-person occasions, particularly when all these gamers are attempting to get into the identical raids on particular gyms directly, is usually a big challenge, and it's clear Niantic are placing a variety of effort into ensuring this gained't be a problem at future occasions.

Spiky QPS is a matter that plagues many points of the sport at in individual occasions, and for raids specifically. There are sometimes studies from the earliest timezones of issues with raids as a result of spoofers, for instance, when the primary Elite Raids occurred, and something that may make the sport smoother for these timezones which might be ceaselessly plagued with recreation glitches and points is a win for the neighborhood.

What do you suppose Niantic can do to enhance the sleek working of the sport for in-person raids, occasions, and the early timezones with spoofer points?

The publish Niantic Talk about Optimisation Throughout Raid Occasions & ‘Spiky QPS' appeared first on Pokémon GO Hub.

Share this Article