Django는 확장됩니까? [닫은]
Django로 웹 애플리케이션을 만들고 있습니다. 내가 Django를 선택한 이유는 다음과 같습니다.
- 무료 / 오픈 소스 도구로 작업하고 싶었습니다.
- 나는 Python을 좋아하고 그것이 장기적인 언어 라고 느낀다 . 반면 Ruby에 관해서는 확실하지 않았고 PHP는 배우기 매우 번거로운 것 같았다.
- 나는 아이디어의 프로토 타입을 만들고 있으며 미래에 대해 너무 많이 생각하지 않았습니다. 개발 속도가 주요 요소 였고 저는 이미 Python을 알고있었습니다.
- 향후 Google App Engine으로 마이그레이션하는 것이 더 쉬울 것이라는 점을 알고있었습니다.
- 장고가 "좋다"고 들었다.
이제 내 작품을 출판 할 생각에 가까워지면서 규모에 대해 걱정하기 시작합니다. Django의 확장 기능에 대해 찾은 유일한 정보는 Django 팀에서 제공 한 것입니다 (이를 무시할 수있는 것은 아니지만 이것은 분명히 객관적인 정보가 아닙니다 ...).
내 질문 :
- 오늘날 Django에 구축 된 "가장 큰"사이트는 무엇입니까? (대부분 사용자 트래픽으로 크기를 측정합니다)
- Django는 매일 사이트를 방문하는 사용자 수 10 만 명을 처리 할 수 있습니까 ?
- Stack Overflow와 같은 사이트를 Django에서 실행할 수 있습니까?
"오늘날 Django에 구축 된 가장 큰 사이트는 무엇입니까?"
Django가 구축 한 사이트의 트래픽에 대한 정보를 수집하는 단일 장소가 없기 때문에 다양한 위치의 데이터를 사용하여 찔러야합니다. 먼저, 메인 Django 프로젝트 페이지 의 첫 페이지에 Django 사이트 목록이 있고 djangosites.org 에 Django 빌드 사이트 목록이 있습니다 . 목록을 살펴보고 적절한 트래픽이있는 것으로 알고있는 일부를 선택합니다.
Pinterest : Alexa 37 위 (2015 년 21.4) 및 2013 년 7 천만 사용자
tabblo.com : 매일 44k 방문 , Ned Batchelder의 게시물 현대 웹 사이트 인프라 참조.
chesspark.com : Alexa 순위는 약 179k입니다.
pownce.com (더 이상 활성화되지 않음) : alexa 는 약 65k 등급입니다. Pownce의 Mike Malone은 Django Web Apps 확장 에 대한 EuroDjangoCon 프레젠테이션에서"초당 수백 건"이라고 말합니다. 이것은 Django를 확장하는 방법에 대한 매우 좋은 프레젠테이션이며 Django 확장 성의 (현재) 단점을 포함하여 몇 가지 좋은 점을 만듭니다.
HP에는 Django 1.5 : ePrint center로 구축 된 사이트가 있습니다 . 그러나 novemer / 2015의 경우 전체 웹 사이트가 마이그레이션되었으며이 링크는 리디렉션 일뿐입니다. 이 웹 사이트는 Instant Ink 및 HP가 제공하는 관련 서비스 (*)에 대한 구독에 참여하는 전 세계 서비스였습니다.
"Django는 매일 10 만 명의 사용자를 처리 할 수 있으며 각 사용자는 몇 시간 동안 사이트를 방문 할 수 있습니까?"
예, 위를 참조하십시오.
"Stack Overflow와 같은 사이트를 Django에서 실행할 수 있습니까?"
내 직감은 '예'이지만 다른 사람들이 대답하고 Mike Malone이 프레젠테이션에서 언급했듯이 데이터베이스 설계가 중요합니다. 신뢰할 수있는 트래픽 통계를 찾을 수 있다면 www.cnprog.com에서도 강력한 증거를 찾을 수 있습니다. 어쨌든 장고 모델을한데 모아서 일어날 일이 아닙니다. :)
물론 더 많은 관심 사이트와 블로거가 있지만 어딘가에서 멈추어야합니다!
Django를 사용하여 트래픽이 많은 사이트 구축 에 대한 블로그 게시물 michaelmoore.com 은 상위 10,000 개 웹 사이트 로 설명됩니다 . Quantcast 통계 및 compet.com 통계 .
(*) 해당 프로젝트에서 아웃소싱 개발자로 일하는 데 사용 된 참조를 포함한 편집 작성자.
우리는 지금 부하 테스트를하고 있습니다. 서버 성능을 크게 저하시키지 않고 240 개의 동시 요청 (초당 120 회 적중률 24x7의 지속적인 속도)을 지원할 수 있다고 생각합니다. 그것은 시간당 432,000 개의 히트가 될 것입니다. 응답 시간은 적지 않지만 (트랜잭션이 많음) 부하가 증가해도 기준 성능이 저하되지 않습니다.
우리는 Apache 프론트 엔드 Django와 MySQL을 사용하고 있습니다. OS는 RHEL (Red Hat Enterprise Linux)입니다. 64 비트. Django의 데몬 모드에서 mod_wsgi를 사용합니다. 기본값을 수락하는 것 외에 캐시 또는 데이터베이스 최적화를 수행하지 않았습니다.
우리는 모두 32Gb RAM을 갖춘 64 비트 Dell의 하나의 VM에 있습니다.
20 명 또는 200 명의 동시 사용자의 경우 성능이 거의 동일하기 때문에 "트위 킹"하는 데 많은 시간을 할애 할 필요가 없습니다. 대신 일반 SSL 성능 향상, 일반 데이터베이스 설계 및 구현 (인덱싱 등), 일반 방화벽 성능 향상 등을 통해 기본 성능을 유지하기 만하면됩니다.
우리가 측정하는 것은 16 개의 동시 요청 스레드를 실행하는 15 개 프로세스의 미친 워크로드로 어려움을 겪고있는로드 테스트 노트북입니다.
일일 방문 횟수는 확실하지 않지만 다음은 대규모 Django 사이트의 몇 가지 예입니다.
- disqus.com ( djangocon 에서 이야기 )
- bitbucket.org ( 작성 )
- lanyrd.com ( 소스 )
- support.mozilla.com ( 소스 코드 )
- addons.mozilla.org ( 소스 코드 ) ( djangocon 이야기 )
- theonion.com ( 쓰기 )
- guardian.co.uk의 코멘트 시스템은 장고 (사용 소스 )
- 인스 타 그램
- rdio
다음은 Quora에서 트래픽이 많은 Django 사이트 목록에 대한 링크 입니다.
오늘날 Django에 구축 된 "가장 큰"사이트는 무엇입니까? (대부분 사용자 트래픽으로 크기를 측정합니다)
미국에서는 마할로 였습니다 . 한 달에 약 천만 개의 고유 항목을 처리한다고 들었습니다. 이제 2019 년에 Mahalo는 Ruby on Rails를 기반으로합니다.
해외, Globo 네트워크 (브라질의 뉴스, 스포츠 및 엔터테인먼트 사이트 네트워크); Alexa는 전 세계 100 위 안에 들었습니다 (현재 약 80 위).
다른 주목할만한 Django 사용자로는 PBS, National Geographic, Discovery, NASA (실제로 NASA 내의 여러 부서) 및 의회 도서관이 있습니다.
Django는 매일 10 만 명의 사용자를 처리 할 수 있습니까? 각 사용자는 몇 시간 동안 사이트를 방문 할 수 있습니까?
예-하지만 애플리케이션을 올바르게 작성했고 하드웨어가 충분한 경우에만 가능합니다. 장고는 마법의 총알이 아닙니다.
StackOverflow와 같은 사이트를 Django에서 실행할 수 있습니까?
예 (위 참조).
기술적으로 쉽게 : 한 번의 시도로 soclone 을 참조하십시오 . 트래픽 측면에서 월별 고유 수가 100 만 개 미만으로 StackOverflow와 경쟁합니다. 나는 적어도 12 개의 Django 사이트에 SO보다 더 많은 트래픽을 지정할 수 있습니다.
웹 앱 확장은 웹 프레임 워크 나 언어에 관한 것이 아니라 아키텍처에 관한 것입니다. 브라우저 캐시, 데이터베이스 캐시, 비표준 지속성 공급자 (예 : CouchDB )를 사용하는 방법, 데이터베이스 및 기타 많은 항목을 조정하는 방법에 관한 것입니다.
악마의 옹호자 역할을 조금 :
You should check the DjangoCon 2008 Keynote, delivered by Cal Henderson, titled "Why I hate Django" where he pretty much goes over everything Django is missing that you might want to do in a high traffic website. At the end of the day you have to take this all with an open mind because it is perfectly possible to write Django apps that scale, but I thought it was a good presentation and relevant to your question.
The largest django site I know of is the Washington Post, which would certainly indicate that it can scale well.
좋은 디자인 결정은 아마도 다른 무엇보다 성능에 더 큰 영향을 미칩니다. Twitter는 다른 동적 해석 언어 기반 웹 프레임 워크 인 Ruby on Rails의 성능 문제를 구현하는 사이트로 자주 인용되지만 Twitter 엔지니어는 프레임 워크가 초기에 선택한 데이터베이스 디자인 선택만큼 문제가 아니라고 말했습니다. 의 위에.
Django는 memcached와 매우 잘 작동하며 대부분의 성능 문제를 해결할 수있는 캐시 관리를위한 몇 가지 클래스를 제공합니다. 유선으로 제공하는 것은 실제로 백엔드보다 거의 더 중요합니다. yslow와 같은 도구를 사용하는 것은 고성능 웹 애플리케이션에 중요합니다. 언제든지 백엔드에 더 많은 하드웨어를 투입 할 수 있지만 사용자 대역폭을 변경할 수는 없습니다.
저는 지난주에 EuroDjangoCon 컨퍼런스에 참석했습니다.이 주제는 가장 큰 Django 기반 사이트 인 Pownce의 창립자 ( 여기 에서 한 번의 강연 에서 슬라이드)를 포함하여 몇 가지 강연의 주제였습니다 . 주요 메시지는 당신이 걱정해야 할 것은 Django가 아니라 적절한 캐싱,로드 밸런싱, 데이터베이스 최적화 등과 같은 것입니다.
Django는 실제로 대부분의 것들에 대한 후크를 가지고 있습니다. 특히 캐싱은 매우 쉽습니다.
I'm sure you're looking for a more solid answer, but the most obvious objective validation I can think of is that Google pushes Django for use with its App Engine framework. If anybody knows about and deals with scalability on a regular basis, it's Google. From what I've read, the most limiting factor seems to be the database back-end, which is why Google uses their own...
As stated in High Performance Django Book and Go through this Cal Henderson
See further details as mentioned below:
It’s not uncommon to hear people say “Django doesn’t scale”. Depending on how you look at it, the statement is either completely true or patently false. Django, on its own, doesn’t scale.
The same can be said of Ruby on Rails, Flask, PHP, or any other language used by a database-driven dynamic website.
The good news, however, is that Django interacts beautifully with a suite of caching and load balancing tools that will allow it to scale to as much traffic as you can throw at it.
Contrary to what you may have read online, it can do so without replacing core components often labeled as “too slow” such as the database ORM or the template layer.
Disqus serves over 8 billion page views per month. Those are some huge numbers.
These teams have proven Django most certainly does scale. Our experience here at Lincoln Loop backs it up.
We’ve built big Django sites capable of spending the day on the Reddit homepage without breaking a sweat.
Django’s scaling success stories are almost too numerous to list at this point.
It backs Disqus, Instagram, and Pinterest. Want some more proof? Instagram was able to sustain over 30 million users on Django with only 3 engineers (2 of which had no back-end development
Today we use many web apps and sites for our needs. Most of them are highly useful. I will show you some of them used by python or django.
The Washington Post’s website is a hugely popular online news source to accompany their daily paper. Its’ huge amount of views and traffic can be easily handled by the Django web framework. Washington Post - 52.2 million unique visitors (March, 2015)
The National Aeronautics and Space Administration’s official website is the place to find news, pictures, and videos about their ongoing space exploration. This Django website can easily handle huge amounts of views and traffic. 2 million visitors monthly
The Guardian is a British news and media website owned by the Guardian Media Group. It contains nearly all of the content of the newspapers The Guardian and The Observer. This huge data is handled by Django. The Guardian (commenting system) - 41,6 million unique visitors (October, 2014)
We all know YouTube as the place to upload cat videos and fails. As one of the most popular websites in existence, it provides us with endless hours of video entertainment. The Python programming language powers it and the features we love.
DropBox started the online document storing revolution that has become part of daily life. We now store almost everything in the cloud. Dropbox allows us to store, sync, and share almost anything using the power of Python.
Survey Monkey is the largest online survey company. They can handle over one million responses every day on their rewritten Python website.
Quora is the number one place online to ask a question and receive answers from a community of individuals. On their Python website relevant results are answered, edited, and organized by these community members.
A majority of the code for Bitly URL shortening services and analytics are all built with Python. Their service can handle hundreds of millions of events per day.
Reddit is known as the front page of the internet. It is the place online to find information or entertainment based on thousands of different categories. Posts and links are user generated and are promoted to the top through votes. Many of Reddit’s capabilities rely on Python for their functionality.
Hipmunk is an online consumer travel site that compares the top travel sites to find you the best deals. This Python website’s tools allow you to find the cheapest hotels and flights for your destination.
Click here for more: 25-of-the-most-popular-python-and-django-websites, What-are-some-well-known-sites-running-on-Django
I think we might as well add Apple's App of the year for 2011, Instagram, to the list which uses django intensively.
Yes it can. It could be Django with Python or Ruby on Rails. It will still scale.
There are few different techniques. First, caching is not scaling. You could have several application servers balanced with nginx as the front in addition to hardware balancer(s). To scale on the database side you can go pretty far with read slave in MySQL / PostgreSQL if you go the RDBMS way.
Some good examples of heavy traffic websites in Django could be:
- Pownce when they were still there.
- Discus (generic shared comments manager)
- All the newspaper related websites: Washington Post and others.
You can feel safe.
Here's a list of some relatively high-profile things built in Django:
The Guardian's "Investigate your MP's expenses" app
Politifact.com (here's a Blog post talking about the (positive) experience. Site won a Pulitzer.
NY Times' Represent app
Peter Harkins, one of the programmers over at WaPo, lists all the stuff they’ve built with Django on his blog
It's a little old, but someone from the LA Times gave a basic overview of why they went with Django.
The Onion's AV Club was recently moved from (I think Drupal) to Django.
I imagine a number of these these sites probably gets well over 100k+ hits per day. Django can certainly do 100k hits/day and more. But YMMV in getting your particular site there depending on what you're building.
There are caching options at the Django level (for example caching querysets and views in memcached can work wonders) and beyond (upstream caches like Squid). Database Server specifications will also be a factor (and usually the place to splurge), as is how well you've tuned it. Don't assume, for example, that Django's going set up indexes properly. Don't assume that the default PostgreSQL or MySQL configuration is the right one.
Furthermore, you always have the option of having multiple application servers running Django if that is the slow point, with a software or hardware load balancer in front.
Finally, are you serving static content on the same server as Django? Are you using Apache or something like nginx or lighttpd? Can you afford to use a CDN for static content? These are things to think about, but it's all very speculative. 100k hits/day isn't the only variable: how much do you want to spend? How much expertise do you have managing all these components? How much time do you have to pull it all together?
The developer advocate for YouTube gave a talk about scaling Python at PyCon 2012, which is also relevant to scaling Django.
YouTube has more than a billion users, and YouTube is built on Python.
I have been using Django for over a year now, and am very impressed with how it manages to combine modularity, scalability and speed of development. Like with any technology, it comes with a learning curve. However, this learning curve is made a lot less steep by the excellent documentation from the Django community. Django has been able to handle everything I have thrown at it really well. It looks like it will be able to scale well into the future.
BidRodeo Penny Auctions is a moderately sized Django powered website. It is a very dynamic website and does handle a good number of page views a day.
Note that if you're expecting 100K users per day, that are active for hours at a time (meaning max of 20K+ concurrent users), you're going to need A LOT of servers. SO has ~15,000 registered users, and most of them are probably not active daily. While the bulk of traffic comes from unregistered users, I'm guessing that very few of them stay on the site more than a couple minutes (i.e. they follow google search results then leave).
For that volume, expect at least 30 servers ... which is still a rather heavy 1,000 concurrent users per server.
Another example is rasp.yandex.ru, Russian transport timetable service. Its attendance satisfies your requirements.
If you have a site with some static content, then putting a Varnish server in front will dramatically increase your performance. Even a single box can then easily spit out 100 Mbit/s of traffic.
Note that with dynamic content, using something like Varnish becomes a lot more tricky.
My experience with Django is minimal but I do remember in The Django Book they have a chapter where they interview people running some of the larger Django applications. Here is a link. I guess it could provide some insights.
It says curse.com is one of the largest Django applications with around 60-90 million page views in a month.
I develop high traffic sites using Django for the national broadcaster in Ireland. It works well for us. Developing a high performance site is more than about just choosing a framework. A framework will only be one part of a system that is as strong as it's weakest link. Using the latest framework 'X' won't solve your performance issues if the problem is slow database queries or a badly configured server or network.
What's the "largest" site that's built on Django today? (I measure size mostly by user traffic) Pinterest
disqus.com
More here https://www.shuup.com/en/blog/25-of-the-most-popular-python-and-django-websites/
Can Django deal with 100,000 users daily, each visiting the site for a couple of hours?
Yes, but use proper architecture, database design, use of cache, use load balances and multiple servers/ nods
Could a site like Stack Overflow run on Django?
Yes, just need to follow answer mentioned in the 2nd question
Even-though there have been a lot of great answers here, I just feel like pointing out, that nobody have put emphasis on..
It depends on the application
If you application is light on writes, as in you are reading a lot more data from the DB than you are writing. Then scaling django should be fairly trivial, heck, it comes with some fairly decent output/view caching straight out of the box. Make use of that, and say, redis as a cache provider, put a load balancer in front of it, spin up n-instances and you should be able to deal with a VERY large amount of traffic.
Now, if you have to do thousands of complex writes a second? Different story. Is Django going to be a bad choice? Well, not necessarily, depends on how you architect your solution really, and also, what your requirements are.
Just my two cents :-)
You can definitely run a high-traffic site in Django. Check out this pre-Django 1.0 but still relevant post here: http://menendez.com/blog/launching-high-performance-django-site/
Check out this micro news aggregator called EveryBlock.
It's entirely written in Django. In fact they are the people who developed the Django framework itself.
The problem is not to know if django can scale or not.
The right way is to understand and know which are the network design patterns and tools to put under your django/symfony/rails project to scale well.
Some ideas can be :
- Multiplexing.
- Inversed proxy. Ex : Nginx, Varnish
- Memcache Session. Ex : Redis
- Clusterization on your project and db for load balancing and fault tolerance : Ex : Docker
- Use third party to store assets. Ex : Amazon S3
Hope it help a bit. This is my tiny rock to the mountain.
I don't think the issue is really about Django scaling.
I really suggest you look into your architecture that's what is going to help you with you scaling needs.If you get that wrong there is not point on how well Django performs. Performance != Scale. You can have a system that has amazing performance but does not scale and vice versa.
Is your application database bound? If it is then your scale issues lie there as well. How are you planning on interacting with the database from Django? What happens when you database cannot process requests as fast as Django accepts them? What happens when your data outgrows one physical machine. You need to account for how you plan on dealing with those circumstances.
Moreover, What happens when your traffic outgrows one app server? how you handle sessions in this case can be tricky, more often than not you'd probably require a shared nothing architecture. Again that depends on your application.
In short Languages is not what determines scale, a language is responsible for performance(again depending on your applications different languages perform differently). It is your design and architecture that makes scaling a reality.
I hope it helps, would be glad to help further if you have questions.
If you want to use Open source then there are many options for you. But python is best among them it have many libraries and a super awesome community. These are reasons which might change your mind:
Python is very good but it is a interpreted language which makes it slow. But many accelerator and caching services are there which partly solve this problem.
If you are thinking about rapid development then Ruby on Rails is best among all. The main motto of this(ROR) framework is to give a comfortable experience to the developers. If you compare Ruby and Python both have nearly same syntaxes.
Google App Engine is very good service but it will bind you in its scope, you don't get chance to experiment new things. Instead of it you can use Digital Ocean cloud which will only take $5/Month charge for its simplest droplet. Heroku is another free service where you can deploy your product.
Yes! Yes! What you heard is totally correct but here are some examples which are using other technologies
- Rails: Github, Twitter(previously), Shopify, Airbnb, Slideshare, Heroku etc.
- PHP: Facebook, Wikipedia, Flickr, Yahoo, Tumbler, Mailchimp etc.
Conclusion is a framework or language won't do everything for you. A better architecture, designing and strategy will give you a scalable website. Instagram is biggest example,this small team is managing such huge data. Here is one blog about its architecture must read it.
Spreading the tasks evenly, in short optimizing each and every aspect including DBs, Files, Images, CSS etc. and balancing the load with several other resources is necessary once your site/application starts growing. OR you make some more space for it to grow. Implementation of latest technologies like CDN, Cloud are must with huge sites. Just developing and tweaking an application won't give your the cent percent satisfation, other components also play an important role.
참고URL : https://stackoverflow.com/questions/886221/does-django-scale
'development' 카테고리의 다른 글
Ruby on Rails의 nil v. empty v. blank에 대한 간결한 설명 (0) | 2020.09.27 |
---|---|
React JSX 내부 루프 (0) | 2020.09.27 |
Node.js에 파일 / 디렉토리가 있는지 동 기적으로 확인 (0) | 2020.09.27 |
ArrayList 변환 (0) | 2020.09.27 |
주어진 요소에 클래스를 어떻게 추가합니까? (0) | 2020.09.27 |