You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, thank you for building such a fascinating framework! I come from the Laravel world, and the transition to AdonisJS has been very smooth.
I built an app that acts as a controlled environment for executing a user-defined script. In this setup, the user defines a validation schema with adonisjs/validator and a parser function that returns an object matching the validation schema. These components are used by a runtime that executes the function with specific arguments and validates its return. The app’s current version is written in Express and handles a load of around 80k requests per minute (RPM). I migrated the app to AdonisJS v6 to leverage the framework, aiming to streamline the development of future features.
Currently, however, I'm experiencing performance issues. We have automated scaling, so this isn't an infrastructure-related problem. The Express app sustains this level of traffic, but in AdonisJS, performance is initially stable, then response times increase, and the app becomes unstable.
When comparing the Express and AdonisJS versions, I found that the Express setup uses a controller object instantiated at app startup, similar to a singleton pattern, so all requests are handled by the same controller object. Based on testing, I identified that AdonisJS seems to create a new controller instance for each request. This raises a few questions:
Could this be causing the app's performance degradation?
If I declare the AdonisJS controller as a singleton in the service provider, what are the implications? Is this approach valid?
Given that the app logic and infrastructure setup remain unchanged, and only the routing and controller logic was adjusted to integrate AdonisJS v6 with the app’s internal components, what options should I explore to identify the root cause of this issue?
Below is the controller function in both Express and AdonisJS. I'm including it because I'm also handling asynchronous logic here, which is essentially a mechanism to avoid implementing a job queue and has worked well so far.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, thank you for building such a fascinating framework! I come from the Laravel world, and the transition to AdonisJS has been very smooth.
I built an app that acts as a controlled environment for executing a user-defined script. In this setup, the user defines a validation schema with adonisjs/validator and a parser function that returns an object matching the validation schema. These components are used by a runtime that executes the function with specific arguments and validates its return. The app’s current version is written in Express and handles a load of around 80k requests per minute (RPM). I migrated the app to AdonisJS v6 to leverage the framework, aiming to streamline the development of future features.
Currently, however, I'm experiencing performance issues. We have automated scaling, so this isn't an infrastructure-related problem. The Express app sustains this level of traffic, but in AdonisJS, performance is initially stable, then response times increase, and the app becomes unstable.
When comparing the Express and AdonisJS versions, I found that the Express setup uses a controller object instantiated at app startup, similar to a singleton pattern, so all requests are handled by the same controller object. Based on testing, I identified that AdonisJS seems to create a new controller instance for each request. This raises a few questions:
Could this be causing the app's performance degradation?
If I declare the AdonisJS controller as a singleton in the service provider, what are the implications? Is this approach valid?
Given that the app logic and infrastructure setup remain unchanged, and only the routing and controller logic was adjusted to integrate AdonisJS v6 with the app’s internal components, what options should I explore to identify the root cause of this issue?
Below is the controller function in both Express and AdonisJS. I'm including it because I'm also handling asynchronous logic here, which is essentially a mechanism to avoid implementing a job queue and has worked well so far.
Any help or idea is welcome
Beta Was this translation helpful? Give feedback.
All reactions