We have a number of Samsung android devices running Bit Web server or Kick Web server (and previously KSWeb) and have encountered a recent issue with the web server and mysql server processes being stopped after a few hours (typically 2) of activity. Any calls to localhost after that return status 503. The device never goes to sleep during that time and starting the services again results in normal operation. We've tried turning optimizations off everywhere we can find them, upgrading from Android 5 to 6 and using Samsung Smart Manager to specify not to optimize the servers for battery use, and finally going to a minimal android image that has all the optimizations turned off, and every time the processes still stop at about the 2 hour mark.

Does anyone have any ideas as to how to identify what is stopping this process, or if it is stopping itself? Thanks.

  • If you are getting a 503 response code, the web server is running. It is just not doing what you expect. I do not know your web server, however, I assume there is a verbose mode for logging that should help. You will want to check the error log file. Most of the time, there are clues in the log file. Also check the access log file for unusual activity before becoming unavailable. If you are making this web server available to the Internet, then there may be a capacity issue or a hack attempt stopping the service. Cheers!!
    – closetnoc
    Feb 15 '17 at 17:43
  • Thanks for the suggestions. We're using these for self-contained form data collection devices, so no outside connections. Feb 15 '17 at 19:11
  • You might want to put your QA testing hat on and create some simple test cases to ensure that there is not a PHP or Java code issue causing an exception. Play user for a while and run through the entire set of processes a few times. I have had to do this for sites in the past and was sometimes surprised by the results. Since PHP and Java are environment languages, you may find that it does not always work as you expect on all OSes, web servers, etc. Who knows for sure? I have seen Java take huge sites down before. Also, talk to users for something that seems to fail.
    – closetnoc
    Feb 15 '17 at 19:37
  • Also pay attention to URLs that contain special characters or any unusual complexity. I have seen URLs cause problems too. I worked with IIS, before retiring, and Apache since the very beginning. While these are stable web servers, still things can go wrong. You may find a code issue with the web server you are using. It can be a mind bender trying to ferret out the problem, however, I always find these issues the most rewarding to solve! Cheers!!
    – closetnoc
    Feb 15 '17 at 19:40
  • This is an existing web application (albeit run locally) that has run well for quite a while, so we assumed that something Android related had started killing the web/db services. All the use cases are the same, except for the 503 every 2 hours or so. I did find interesting log entries: Feb 15 '17 at 20:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.