Django development server hangs and suddenly does all requests on CTRL+C - django

I am using django for a REST API at my company and have a few people using the first small part of my app via a Samsung tablet. They connect via WiFi to a angular front-end on Apache, that makes API requests to my django development server.
But every now and again the server just freezes intermittently. The front end would work and you can navigate it, but no API calls are going through. And then when ever I press CTRL+C on the development server console, suddenly all the request go through. Depending on how long someone have struggle, there may be 20 API requests that all go through.
At these moments even when I change something in Django in vs-code, nothing happens server side, but when I press CTRL+C suddenly even ALL the server restarts also go through. So I can see that all the request are standing in line just waiting for the server to wake up and then they are all processed. It also looks to me if this mostly happens with the tablet (and not my desktop), where we are using Chrome.
I read that the server is now multi threaded, so that can not be the problem, and I also do not have anti-virus that can stop the server requests.
I do not really know what else to say, it has been 2 weeks of frustration now and continual searching for answer with no luck.

I suspect that the issue is with you using the dev server, where one request is taking too long. If you already have apache installed you can use mod_wsgi to connect to Django like described here
Django With Apache

Related

Meteor js - client view doesnt update (AWS Lightsail + Nginx reverse proxy)

My Meteor app doesnt want to work properly when uploaded to AWS Lightsail.
The problem is - when I update a document in collection the changes are not reflected on the client, and even more strange - the updated variable disappears from the client view.
Everything works well in development on my local machine though. I also had the same app deployed to my office server machine and was running without any issues.
I created simple script to reproduce the problem, see on the vid: https://streamable.com/mnu26j
So adding or removing document reflects without issue on the client side, but when I try to edit a variable (name) - it saves it to the database, but the client doesnt the reflect the change until I refresh the page.
To me it feels like there might be some problem with maybe wrongly configured websocket connection that doesnt work together with AWS services, but I might be totally wrong on that. In the full version of the app the websocket was constantly reconnecting and closing connection when I tried to authenticate the user (in a cycle of few hundred times per minute) and the app was stuck on log in screen.
Maybe someone has already met a similar problem or at least would have some clue where I could look for a cause of it?
Let me know if you want me to provide any more details.

Why does opening the Chrome Console solve long wait issue?

My colleagues & I are building an Angular 4 app with a Django back-end. Periodically we have to wait a long time for a request to go out from the UI to the web-server. Yet if one opens up the Chrome Console then this seems to effect the request to immediately go out and provide the desired response.
We're trying to get a handle on what's going on. Any ideas?
Robert

What are the possible bugs that cause slow response (sometimes but not all the time) for a websocket connection?

I know my question's topic is too broad. Please ask on anything that can help you find my question more answerable.
CONTEXT: The web architecture is like the following description:
A front-end view generated by Django View, accessible through ngInx
server. The javascript is responsible for send/receive data to/from
web socket app.
A web socket app written in python that makes use of uwsgi server as its communication protocol.
The web socket app communicates with a remote server(C++) using topics and rabbitMQ.
The data is serialized using protobuf.
Version: Django 1.7.7, Python 2.7.5, rabbitMQ 3.4.4, nginx 1.6.2 and uwsgi 2.0.10
PROBLEM: Right now I'm facing a bug that is very nightmarish in the sense that it is hard to find out the bug's root cause, it happens during production and does not always appear.
Sometimes the web socket is responding very slow (1 or 2 minutes) when the user clicks on buttons while the rest of the time the response time is in milliseconds.
I suspect that the bug is due to configuration of the architecture rather than the code itself since the bug only appears sometimes. Also, I can edit the question to add in code if you think I need to. The front-end has a heartbeat back-and-forth connection with the websocket app so internet connection is ruled out. Any idea on how to debug this?
Thank for reading this question. :)

ColdFusion Site Keeps Crashing Every Day

I have a Windows Server 2008 with IIS 6. There are 5 ColdFusion 9 sites running on the server. There are 2 specific sites that keep crashing every day and I am not able to track down the cause of the crash. The site simply stops responding to any requests. At the time of crash the SQL server looks good (no deadlocks found).
In order to bring the site back online I just need to restart the ColdFusion server or IIS services. ColdFusion logs look good and there is no error found in the IIS logs of the site. There is enough space on the 'C' drive so that the logs can grow.
What else am I missing? Please help me to find the cause of crash.
If you are using apache server there might be location that was missing or wrongly declared. try to see the config or log files. if you are using IIS then there might be a connector problem. Try to create a new application pool

Django Comet/Long Pollling application

I am working a real-time lighting control system.
User can turn on/off lights through web interface, but when another person turn on/off light switch manually the web interface should be updated immediately. That's the real-time goal I want.
The structure of the system is like this.
I have my own server at home, which control/monitor light status real-time. Django project is on my cloud server communicating with my home server real-time.
I have searched some similar posts and found many tools that confuse me a lot. All I want is to do long polling. User's browser will send http request to django server periodically(say 30s). If nothing comes up, server will hold the response until next one come. If there is an event, server will just reply immediately so real-time change at the browser side.
I know websocket is a better way, but I just want to make it work, the simpler the better. As long as it's reliable, compatible with existing browsers, performance is not a primary concern for me now. I can change it later if there is performance issue when scaling up. If it's possible, I still want to use Apache server to do this.
Does anyone knows a good tutorial or example that shows me how to implement it?
Thanks so much
I use Django 1.4, wsgi, Apache.