How to Handle Multiple Request for a Particular API in Laravel - laravel-5

I have developed a web application using laravel , This Application consists API for Device Registeration. In order to Test this Application I used Apache JMeter to hit the API. Initially I send 500 request at a time to API using Apache JMeter(By creating threads) and application woked fine , But if I send 2000 request at a time to API only 1500 requests are being handled by laravel application.
So is there any configuration in Laravel to handle multiple request for particular API ??
API -
Route::post('device', 'DeviceManagementController#device');
Thanks in Advance

Related

Grafana plugin - CORS issue with REST API

I'm currently developing grafana plugin using Angular-1 and ES6, retrieving data from REST API and representing them in grafana. The problem is that as far as grafana plugin is working within the browser, it sends ajax calls to our REST API and they are blocked:
No 'Access-Control-Allow-Origin' header is present on the requested resource. The response had HTTP status code 401.
We were required to solve this issue without adding that header on the REST API side. One simple solution was to use corsproxy.
But I'm curios to know whether there is some other way to use REST API within grafana. If I set up some datasource to my plugin, will it work as a kind of backend or my calls to REST API will still be AJAX calls?

Ajax call by HTTP request in angular 2

I am trying to load some user data from database to my angular 2 page. I am doing the angular 2 as separate application and using ReST APIs for get data. My back-end is designed using spring and spring boot and maven tool. So when I am using my angular 2 page, is it possible to load my data from spring boot micro services using Ajax call? Angular 2 supporting Ajax call for HTTP request?. If possible, can anyone share any reference link for exploring the Ajax with http request in angular 2?
So when I am using my angular 2 page, is it possible to load my data
from spring boot micro services using Ajax call?
Yes, that's what Angular is built for, single page applications which calls back Restful services for data. Only thing is I wouldn't phrase it as AJAX call (sounds like an old school :) ) I would rather call it as REST service call.
Angular 2 supporting Ajax call for HTTP request?
Yes it does, that's what Angular is built for
If possible, can anyone share any reference link for exploring the
Ajax with http request in angular 2?
Any sample Angular App with a backend will serve as an example. You will be able to find lots of examples by just googling it. Even if I am providing the code here, it will become irrelevant overtime as angular library itself is evolving. So, I would say, wise thing to do is, check their official website (angular.io, not angularjs that's angular 1.X, ancient stuff) and look for http call examples (eg. tour of heroes project).

How to do correlation on dynamic parameter that are occuring in request and not in response in JMETER?

I am developing a mobile script using jMeter. i.e trying to record and replay mobile web applications using JMeter 2.9 and firefox 43.0.4
I am able to record the application. But it throws an error during replay, as some dynamic parameter is passed with the post data as below:
POST data:
skin=&skinLoaderChecksum=&isAjaxRequest=true&**x=****0.7379947959390617**
When I checked the same flow in Load Runner, the same failure occurs on the same URL again.
In Load Runner:
HTTP Status-Code=500 (Internal Server Error) and {"errorCode":"UNEXPECTED_ERROR","errorMsg":"FWLSE0009W: User identity is null. Check your application''s authentication requirements. These settings must match to the deployed application [project mobile]"}
In JMeter:
Response headers:HTTP/1.1 401 Unauthorized in Sampler Result and in response data: /-secure- {"challenges":{"wl_antiXSRFRealm":{"WL-Instance-Id":"geqcaecehouktkfn0rfqmmdu6"}}}/
Is anyone able to help with this?
Responses will be highly appreciated :-).
I don't have Worklight server to play with now hence I can provide you only generic information. You need to properly simulate mobile application authentication flow, actually this dynamic parameter can be fetched from the previous response.
Reference links:
How to do Worklight Server performance testing
How to Load Test CSRF-Protected Web Sites

Spring client for server send events

I am using the ResponseBodyEmitter in Spring 4.2 RC1 for sending JSON object as part of the server send events. I am able to see the response in web browser. Is there any spring client for the same ?
I tried using AsyncRestTemplate, but I am getting all the response together. Ie if I am sending 3 objects one after another using ResponseBodyEmitter , using AsyncRestTemplate, I get all of them together. I would like to receive in client as and when the server sends it.
You could give a go to Reactor HTTP client if you're into async and reactive programming: https://github.com/reactor/reactor/blob/master/reactor-net/src/test/groovy/reactor/io/net/http/HttpSpec.groovy#L74.

Caching dynamic REST content in Cherokee

I'm developing a backend server for a mobile app using Cherokee + PHP-FPM + MySQL. I'm providing a RESTful API using Luracast Restler 2.
How do you cache dynamic content so that, for example, once a client has requested a list of items through the REST API, this list (in JSON format) is cached for every other client request until the content validity is set to expire? A global cache mechanism for all clients?
Restler 3 final release will have server side caching support built in the framework itself. Currently you have to implement it on your own within the api method

Resources