Comments (8)
The docs already say not to use DatabaseChannelLayer, but I'll reinforce it. It's really not fast with the built in Django stuff (which chunks things into 4KB chunks to serve them!)
I'm going to make it re-chunk them up to a bigger size, but yes, try the Redis backend or the in memory backend if you're just using runserver.
from channels.
Ok, I noticed it's not fast, and I am good with it (after all, debug mode ..), but it is not usable at all as it crashes the server. I am talking about an angular app so quite large assets (default main angular.js file is about 1Mo, add a few more dependencies ... ).
I'll see if can work on daphne to handle static files directly from twisted, maybe with static_dir/url option ?
from channels.
No, just use the in memory backend, it should be faster than normal runserver (channel layer asgiref.inmemory.InMemoryLayer
)
from channels.
Obviously, in production, you wouldn't serve static files through Daphne anyway - I just want to make sure runserver
is usable.
from channels.
All right ! much better !
Then why the "Quickstart" guide tell to use the Database layer ? . Obviously I a fast webserver for my statics, channels or not ...
from channels.
It's there because it's the only one that works with multiple processes and without installing extra things (like Redis). I hope to improve the performance of static file serving on the database backend to at least acceptable levels, though - I'll either get that to an alright level or reword it to suggest redis or memory backends.
from channels.
Wonderful, asgiref.inmemory.ChannelLayer
works sufficiently well for my dev/test purposes.
I don't know if it is "large" assets, parallel fetch of them or the combination, but database backed layer fails, quasi consistently.
from channels.
The database layer needs proper transaction support to correctly do message delivery - given that you were using SQLite, it's likely that it wasn't correctly being fully serialisable and so not working!
I might just dump the database one from the docs entirely, and switch the examples to use InMemory at the start.
from channels.
Related Issues (20)
- Question about versions HOT 1
- initkwargs wasn't set in result consumer HOT 7
- `TEST_CONFIG` key has code using it but seems to be broken and no longer documented HOT 2
- AttributeError: 'NoneType' object has no attribute 'group_add' HOT 1
- OriginValidator could raise exception/log message for denied connections HOT 1
- Unable to collect code coverage when using `ChannelsLiveServerTestCase` HOT 14
- error in channel layer explanations HOT 2
- adding a check if group_name exists method for channel_layer HOT 1
- Small messages are getting concatenated HOT 1
- How can I change the schema in the database? HOT 1
- How to test send_json() contents when passing close=True HOT 2
- Handler declaration by decorator/annotation (in order to prevent potential method leaks) HOT 1
- django-q2 and django-channels together HOT 1
- Channel Layer's group_send() Not Working When Called From Django View HOT 3
- Add CORs middleware HOT 1
- Breakage in routing.py on django/main pre-5.1.
- Use Django async-native APIs where possible HOT 4
- Django Channels Memory Leak on every message or connection HOT 18
- WARNING daphne.server ASGIStaticFilesHandler WebRequest took too long to shut down and was killed
- Use group_send() when group is empty HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from channels.