Improving Scalability with Concurrency for Recurring Background Tasks
Loading...
URL
Journal Title
Journal ISSN
Volume Title
Perustieteiden korkeakoulu |
Master's thesis
Unless otherwise stated, all rights belong to the author. You may download, display and print this publication for Your own personal use. Commercial use is prohibited.
Authors
Date
2024-03-11
Department
Major/Subject
Computer Science
Mcode
SCI3042
Degree programme
Master’s Programme in Computer, Communication and Information Sciences
Language
en
Pages
64
Series
Abstract
Concurrency has been used in computers for decades. If an application does not support concurrency, it is usually hard to scale it with little effort, since that requires extensive optimizations to the software. In this thesis, we implemented support for concurrency in the execution of recurring background tasks in the commercial desktop application, Effector. Effector is developed by the Finnish software company Polycon. It runs recurring background tasks, which are called pollers. The current polling infrastructure uses only one thread to run all tasks, which is prone to errors since failure or an infinite loop in any of the tasks causes the whole pipeline to stall. These stalls cause serious problems: for example, they stop information exchange between services and may even endanger patient safety if the correct information cannot move to the right location at the right time. In this thesis, we implemented a solution to the poller infrastructure delay problem by developing a new implementation that uses multiple threads to run pollers. The threading model for the implementation was chosen based on literature analysis, and the criteria for the choice were also selected using the existing literature. In addition to the main solution, we implemented a log wrapper that allows log messages from multiple threads to be automatically bundled with the respective thread and poller information. We pushed the new solution into selected customer production environments to enhance the execution of pollers in them. In the future, the deployment will cover all customer production environments. Finally, we created a metric to calculate the number of delay messages in each customer organization. We then collected and analyzed data related to poller delays created using that metric. We noticed that there were massive delays with the single threaded implementation, resulting at most 42 thousand poller delays during a month in one of the Effector organizations and average delays being over an hour in another. We observed using new data collected from an Effector organization that the new solution has removed these delays, making the software more stable and reliable, and ensuring real-time data transfer in all cases.Rinnakkaisuutta on käytetty tietokoneissa jo vuosikymmeniä. Jos sovellus ei tue rinnakkaisuutta, sitä on yleensä vaikea skaalata pienellä vaivalla, koska se edellyttää ohjelmistoon tehtäviä laajoja optimointeja. Tässä opinnäytetyössä toteutimme tuen rinnakkaisuudelle toistuvien taustatehtävien suorittamisessa kaupallisessa työpöytäsovelluksessa Effectorissa. Effectoria kehittää suomalainen ohjelmistoyritys Polycon. Se ajaa toistuvia taustatehtäviä, joita kutsutaan pollereiksi. Nykyinen infrastruktuuri käyttää vain yhtä säiettä kaikkien tehtävien suorittamiseen, mikä on altista virheille, koska epäonnistuminen tai ääretön silmukka missä tahansa tehtävässä aiheuttaa koko suorituksen pysähtymisen. Nämä pysähtymiset aiheuttavat vakavia ongelmia: ne esimerkiksi pysäyttävät palvelujen välisen tiedonvaihdon ja voivat jopa vaarantaa potilasturvallisuuden, jos oikeat tiedot eivät pääse oikeaan paikkaan oikeaan aikaan. Tässä opinnäytetyössä kehitettiin ratkaisu nykyisen infrastruktuurin viiveongelmaan kehittämällä uusi toteutus, jossa pollereita ajetaan useiden säikeiden avulla. Toteutuksen säikeistämismalli valittiin kirjallisuusanalyysin perusteella, ja myös valintaperusteet valittiin kirjallisuuden avulla. Varsinaisen ratkaisun lisäksi kehitimme lokitoiminnallisuuden, joka mahdollistaa useammasta säikeestä tulevien lokiviestien liittämisen niihin vastaaviin säie- ja polleritietoihin. Otimme uuden ratkaisun käyttöön ennalta valittujen asiakkaiden tuotantoympäristöissä, jotta niissä voitiin tehostaa pollereiden suorittamista. Tulevaisuudessa käyttöönotto tulee kattamaan kaikkien asiakkaiden tuotantoympäristöt. Lopuksi, loimme metriikan, jolla voi laskea myöhästymisviestien määrää asiakasympäristöissä. Keräsimme ja analysoimme ajojen viivästymisiin liittyviä tietoja, jotka oli luotu tämän metriikan avulla. Huomasimme, että yksisäikeisessä toteutuksessa oli suuria viiveitä: yhdessä organisaatiossa niitä oli jopa 42 tuhatta kappaletta yhden kuukauden aikana, toisessa keskimääräiset viiveet olivat yli tunnin samalla ajanjaksolla. Huomasimme asiakasympäristöstä kerättyjen uusien tietojen avulla, että uusi ratkaisu on poistanut viiveet ja tehnyt ohjelmistosta vakaamman ja luotettavamman, samalla varmistaen reaaliaikaisen tiedonsiirron kaikissa tapauksissa.Description
Supervisor
Kaski, PetteriThesis advisor
Jakobsson, MårtenKeywords
concurrency, poller, recurring background task, scalability