I've got an application on App Engine (Java) with a Cloud SQL db behind it. My mobile app connects with it via Google Cloud Endpoints.
The issue is, that when I leave an instance idle for a long time, the next time I do a request on an endpoint (even with a simple GET request in the browser/Postman in Chrome), I almost always get a 204 No Content back. The app engine logs just seems normal. However, once I shutdown the instance, and do the request again, I always get the response JSON i need.
Furthermore, once it DOES respond, it keeps responding until I leave it idle for a longer period. Then again I often get a HTTP 204.
Any advice?
Please take a look at this FAQ - https://developers.google.com/cloud-sql/faq#sometimes_slow
Related
There is an issue while calling the REST API and the application resides in AWS. This call is made from Azure APIM and kind of PROXY call. It means , in the Java code there is an another URL visible to the user and while calling in turn call the REST API of the application which is in AWS.
There is an intermittent issue of not getting response few times. Most of the times , there is 200 response but few times 500 INTERNAL SERVER error is returned.
Mostly , this seems there is a network issue.
As a workaround , retry mechanism is added to call the API 3 times. Still , few failures are noticed in production.
As of today, it's an unknown that where exactly the request from Azure (APIM) -> AWS is rejected/lost.
2.The request is not reaching HAPROXY in AWS side
requesting experts to help with your suggestions for the further investigation steps.
We are using Jersey 1.6 on a RESTful Server, when a request is started, but takes to long and the client timesout (can be replicated with postman and cancelling request) the request is only partially completed and some but not all database calls are done, leaving the database in a inconsistant state. I thought REST servers, always complete the calls no matter what happens to the client, but this does not seem to be true here. No exceptions are logged in our logging system, what does Jersey do to a request if the client timesout?
I thought REST servers, always complete the calls no matter what happens to the client, but this does not seem to be true here.
This is incorrect assumption. REST describes just the way of
interaction, it is still under service developer's responsibility to
make the database changes consistent(transactional) if needed.
No exceptions are logged in our logging system, what does Jersey do to a request if the client timesout?
It will still send the response, but the client will ignore it due to timeout.
I'm currently building a web spider with java apache commons. I'm crawling basic google search queries like https://google.com/search?q=word&hl=en
Somehow after about 60 queries I get blocked, it seems they recognize me as a bot and I get a 503 Service Unavailable response
Now the important part:
If I visit the same site with firefox/chrome I get the desired result.
If I make a GET Request with my Application using the same http header (user-agent, cookies, cache etc.) I am still blocked.
HOW does Google know whether I'm connecting via Application or Chrome-Browser, when there is only the IP and the HTTP-Header as Information?(maybe I'm wrong?)
Are there more parameters to recognize my App? Something that Google sees and I don't?
(Maybe important: I'm using Chrome Developer Tools and httpbin.org to compare the headers of Browser and Application.)
Thanks a lot
Since you have not specified how quickly you send the 60 queries, I am assuming at a high rate. This is why google is blocking you. Several times I have rapidly done google searches from chrome and it asks for a captcha after a while and then blocks soon after.
Please see the API on Custom Search and this post about terms of Service Replacement for Google API
FAQ on blocked searches: Google FAQ
Currently I'm working on a single page application with java/jersey running as my back-end. But at the moment I have some requests that take a while (over 10 seconds). I was wondering if its possible to send updates back to the client with jersey?
I wanna use like a status bar but I have no clue how far the request is without updates from the back-end.
I couldn't find anything about this topic searching on google/stackoverflow. Maybe I'm using the wrong search terms.
If you don't want to use websockets there are a few approaches you can take.
Provide API to client that takes clientId and optionally processId and gives status of the process running on server.
Then client can have Javascript to asynchronously call this API and update progress bar.
In addition you can have server side Jersey resource start long running process asynchronously and immediately return response with estimated time and processId.
I am working on web based applications.
Server : Tomcat
Technology : Simple Jsp/Servlet/JQuery
I need to restart my server as an when new updates are there. And these changes are frequent almost every 1 or 2 day. I think to create some mechanism like I can say to every logged in user to save their changes and server will start in few minutes. (Timer will be there). Popup should be open though user is ideal.
Is there any direct way to do this so? Or I need to implement ajax call on every few seconds to server on every jsp page to check if any message is there on server???
Any idea will be appreciated.
Thanks in advance.
For the approach you are taking, I would suggest you to use Async Serlvets(Req. min Servlet API 3.0) or Apache Tomcat's comet technology(Kind of Async Servlet).
You will make ajax call on every page when it(page) loads(ajax onload() for eg.) to Async Servlet and will idle until response from server comes. This Async servlet should send Server Restart notification to all connected clients- whenever you trigger notification manually. Once ajax client gets notification, it will display the Warning(or user friendly message).
This will remove the need to make unnecessary polling to server after fixed internal - A big plus resource wise.
Personally I wont suggest this way, better get agreed on specific timeframe for deployment everyday(every two days) with clients and perform deployments in this time.
If you are from India- You must be aware about IRCTC website- Which is not available for train reservation every night for 1 hour.