Closed zlg9folira closed 2 years ago
After linking Apache I am faced two issues: 1- By running the service I get an error:
Failed to deploy [myservice].
Can't load service: .../ngrest/myservice/.ngrest/local/build/services/myservice.so: Service myservice.myclass is already registered
I have developed my service to be in the form : /myservice/myclass
, so the only namespace used is myservice
.
2- I am testing PUT
method at 20Hz to update data on http://localhost/ngrest/service/myservice.myclass
and reading it pack at the same pace. I noticed random lags, also order of is not consistent while reading back, (like 1,2,3,4,5,2,7). I don't have this issue when I use my service on http://localhost:9098/ngrest/service/myservice.myclass
. Is there any fix for this ?
1 maybe you have two services/.so with the same class name?
2 The inconsistent order should be ok, because of stateless property of REST. To handle requests Apache spawns few worker processes/threads. When you send request to Apache it routes to the worker by the internal logic, which can't be controlled by the app. You may try to change it's properties or switch to prefork.
Thanks @loentar, I have been playing with all the settings, Apache2 prefork
and worker
, also tried Nginx. I could never get the performance (accessibility, speed) that I experience on actual port 127.0.0.1:9098. I ended up configuring a simple IP/port forwarding instead of deploying under either web sever. This enables ngrest to be accessed on localhost default port but it is very stable and reliable. I will continue exploring this great tool. Appreciate it.
I followed this guide: https://github.com/loentar/ngrest/wiki/Deploy-ngrest-under-Apache2-Web-Server.
Inside
/home/user/.ngrest/ngrest-build/deploy/share/ngrest/services
I only have two.so
files forServerStatus
andFavicon
. My custom services are missing there. How can I create and run anyngrest
service and get them linked to Apache ?EDIT: Folder
.ngrest
was hidden in my project folder, and I skipped coping my custom.so
file to/home/user/.ngrest/ngrest-build/deploy/share/ngrest/services/
. It is now linked! However, I have two separate services. objects IPOST
tolocalhost:9098
are not visible onlocalhost
and vice versa.