ruby on rails - Separated threads according to url path -


I am using Puma and Engex to run my Rubyius app.

I want to separate my url request

The first API will be for requests, the second will be the second for the requests

I think Puma is already threading But I want to make sure that the web request will not block a thread that stops during my API requests. I think if a thread is busy then Puma will make one more but I have to make sure that one is always available for API requests.

My main point is a thread "Save" for the URL requests that most users need

Thank you for your light.

Since Puma considers each request within different threads, such threads use the database The only barrier to do is In addition, you can not guarantee a few threads better than others.

Here's one of the possible solutions to be addressed by using nginx . Let's say that you are serving content on the app http://some_host.com and API http://some_host.com/api Is available within You can configure nginx for http://some_host.com and http://some_host.com/api separately. In this case, you will need two different examples of the Puma server for the base application and for an API request. I mean, when a request arrives at http://some_host.com , then it is controlled by Puma A and when http: // Some_host happens by Com / API / / / Code>, Puma B .

Just remember one thing, you can handle the request with different examples, but you have a database now, unless you are not caching content here comes another question. Cache your content? If not, will not it be considered more to start with caching?


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -