简体   繁体   English

Laravel RESTful服务上的大量API请求

[英]Large quantities of API requests on a Laravel RESTful service

So I have an app that does API call every minute or so to update local db on the app. 因此,我有一个应用程序每分钟执行一次API调用,以更新该应用程序上的本地数据库。

I don't know about scalability in this scenario, but let's say I have 100 users, so that makes it 100 api calls a minute or so. 我不知道这种情况下的可伸缩性,但可以说我有100个用户,因此每分钟大约有100个api调用。

How bad is this? 这有多糟?

Is there a way to mock hundreds of api calls? 有没有办法模拟数百个api调用?

The scenario you explained above won't be bad at all, even when performed in a small server, assuming the call you are making is relatively short and does not use lots of memory in the server. 即使您在小型服务器中执行上述假设,但您假设的通话时间相对较短,并且不会占用服务器中的大量内存,因此上述情况也不会很糟糕。 This could be more efficient if you spin up more workers threads in your server. 如果您在服务器中增加更多工作线程,这可能会更有效率。

Laravel's documentation explains a little more. Laravel的文档解释了更多。

Alternatively, you could use a well-known Java framework called JMeter to test your API calls in any scenarios you may want. 另外,您可以使用一个称为JMeter的著名Java框架在您可能需要的任何情况下测试您的API调用。

For more visit their documentation . 有关更多信息,请访问他们的文档

I hope this helps! 我希望这有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM