Django 每天的访问量是否超过 10 万次?

发布于 2024-07-20 07:44:29 字数 1706 浏览 9 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(29

感性 2024-07-27 07:44:29
  1. “当今基于 Django 构建的最大的网站是什么?”

    没有任何一个地方可以收集 Django 构建的网站上的流量信息,因此我必须使用来自不同位置的数据来尝试一下。 首先,我们在 Django 项目主页面 的首页上有一个 Django 站点列表,然后是Django 在 djangosites.org 上构建了站点。 浏览列表并选择一些我知道具有良好流量的列表,我们发现:

  2. “Django 可以每天处理 100,000 个用户,每个用户访问该网站几个小时吗?”

    是的,参见上文。

  3. “像 Stack Overflow 这样的网站可以在 Django 上运行吗?”

    我的直觉是肯定的,但是正如其他人的回答和迈克·马龙在他的演讲中提到的那样,数据库设计至关重要。 如果我们能找到任何可靠的流量统计数据,也可以在 www.cnprog.com 上找到强有力的证据。 无论如何,这不仅仅是将一堆 Django 模型放在一起会发生的事情:)

当然,还有更多感兴趣的网站和博主,但我必须在某个地方停下来!


关于使用 Django 构建 high- 的博客文章流量网站 michaelmoore.com 被描述为排名前 10,000 的网站Quantcast 统计数据compete.com 统计数据


(*) 编辑(包括此类参考)的作者曾在该项目中担任外包开发人员。

  1. "What are the largest sites built on Django today?"

    There isn't any single place that collects information about traffic on Django built sites, so I'll have to take a stab at it using data from various locations. First, we have a list of Django sites on the front page of the main Django project page and then a list of Django built sites at djangosites.org. Going through the lists and picking some that I know have decent traffic we see:

  2. "Can Django deal with 100,000 users daily, each visiting the site for a couple of hours?"

    Yes, see above.

  3. "Could a site like Stack Overflow run on Django?"

    My gut feeling is yes but, as others answered and Mike Malone mentions in his presentation, database design is critical. Strong proof might also be found at www.cnprog.com if we can find any reliable traffic stats. Anyway, it's not just something that will happen by throwing together a bunch of Django models :)

There are, of course, many more sites and bloggers of interest, but I have got to stop somewhere!


Blog post about Using Django to build high-traffic site michaelmoore.com described as a top 10,000 website. Quantcast stats and compete.com stats.


(*) The author of the edit, including such reference, used to work as outsourced developer in that project.

吹梦到西洲 2024-07-27 07:44:29

我们现在正在进行负载测试。 我们认为我们可以支持 240 个并发请求(持续每秒 120 次点击,24x7),而不会显着降低服务器性能。 那将是每小时 432,000 次点击。 响应时间并不短(我们的事务量很大),但随着负载的增加,我们的基准性能并没有下降。

我们使用 Apache 前端 Django 和 MySQL。 操作系统是红帽企业 Linux (RHEL)。 64 位。 我们在 Django 的守护进程模式下使用 mod_wsgi。 除了接受默认值之外,我们没有进行任何缓存或数据库优化。

我们都在一台 64 位 Dell 虚拟机上(我认为是 32Gb RAM)。

由于 20 或 200 个并发用户的性能几乎相同,因此我们不需要花费大量时间“调整”。 相反,我们只需要通过普通的 SSL 性能改进、普通的数据库设计和实现(索引等)、普通的防火墙性能改进等来保持我们的基本性能。

我们测量的是我们的负载测试笔记本电脑在疯狂的工作负载下挣扎15 个进程运行 16 个并发请求线程。

We're doing load testing now. We think we can support 240 concurrent requests (a sustained rate of 120 hits per second 24x7) without any significant degradation in the server performance. That would be 432,000 hits per hour. Response times aren't small (our transactions are large) but there's no degradation from our baseline performance as the load increases.

We're using Apache front-ending Django and MySQL. The OS is Red Hat Enterprise Linux (RHEL). 64-bit. We use mod_wsgi in daemon mode for Django. We've done no cache or database optimization other than to accept the defaults.

We're all in one VM on a 64-bit Dell with (I think) 32Gb RAM.

Since performance is almost the same for 20 or 200 concurrent users, we don't need to spend huge amounts of time "tweaking". Instead we simply need to keep our base performance up through ordinary SSL performance improvements, ordinary database design and implementation (indexing, etc.), ordinary firewall performance improvements, etc.

What we do measure is our load test laptops struggling under the insane workload of 15 processes running 16 concurrent threads of requests.

江南烟雨〆相思醉 2024-07-27 07:44:29

不确定每日访问量,但这里有一些大型 Django 网站的示例:

这是 Quora 上的高流量 Django 网站

Not sure about the number of daily visits but here are a few examples of large Django sites:

Here is a link to list of high traffic Django sites on Quora.

荒岛晴空 2024-07-27 07:44:29

当今基于 Django 构建的“最大”网站是什么? (我主要通过用户流量来衡量大小)

在美国,它是 Mahalo。 我听说他们每月处理大约 1000 万个独立用户。 现在,2019 年,Mahalo 由 Ruby on Rails 提供支持。

在国外,Globo 网络(巴西的新闻、体育和娱乐网站网络); Alexa 将它们列为全球前 100 名(目前排名第 80 位左右)。

其他著名的 Django 用户包括 PBS、国家地理、Discovery、NASA(实际上是 NASA 内的许多不同部门)和美国国会图书馆。

Django 可以每天处理 10 万用户,每个用户访问网站几个小时吗?

是的——但前提是您正确编写了应用程序,并且拥有足够的硬件。 姜戈不是一颗神奇的子弹。

像 StackOverflow 这样的网站可以在 Django 上运行吗?

是的(但见上文)。

从技术角度来看,很简单:请参阅 soclone 尝试一下。 从流量角度来看,StackOverflow 的竞争者每月独立访问量低于 100 万。 我可以说出至少十几个流量比 SO 更多的 Django 网站。

What's the "largest" site that's built on Django today? (I measure size mostly by user traffic)

In the US, it was Mahalo. I'm told they handle roughly 10 million uniques a month. Now, in 2019, Mahalo is powered by Ruby on Rails.

Abroad, the Globo network (a network of news, sports, and entertainment sites in Brazil); Alexa ranks them in to top 100 globally (around 80th currently).

Other notable Django users include PBS, National Geographic, Discovery, NASA (actually a number of different divisions within NASA), and the Library of Congress.

Can Django deal with 100k users daily, each visiting the site for a couple of hours?

Yes -- but only if you've written your application right, and if you've got enough hardware. Django's not a magic bullet.

Could a site like StackOverflow run on Django?

Yes (but see above).

Technology-wise, easily: see soclone for one attempt. Traffic-wise, compete pegs StackOverflow at under 1 million uniques per month. I can name at least dozen Django sites with more traffic than SO.

零時差 2024-07-27 07:44:29

扩展 Web 应用程序与 Web 框架或语言无关,而是与您的架构有关。
这是关于如何处理浏览器缓存、数据库缓存、如何使用非标准持久性提供程序(例如 CouchDB ),你的数据库和许多其他东西的调整程度如何......

Scaling Web apps is not about web frameworks or languages, is about your architecture.
It's about how you handle you browser cache, your database cache, how you use non-standard persistence providers (like CouchDB), how tuned is your database and a lot of other stuff...

别低头,皇冠会掉 2024-07-27 07:44:29

唱反调:

您应该查看 DjangoCon 2008 主题演讲,由 Cal Henderson,标题为“为什么我讨厌 Django”,他几乎回顾了 Django 所遗漏的所有内容想做一个高流量的网站。 归根结底,您必须以开放的心态接受这一切,因为编写可扩展的 Django 应用程序完全有可能,但我认为这是一个很好的演示并且与您的问题相关。

Playing devil's advocate a little bit:

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.

栩栩如生 2024-07-27 07:44:29

我所知道的最大的 django 网站是 Washington Post,这肯定表明它可以 规模良好。

良好的设计决策可能比其他任何事情都对性能产生更大的影响。 Twitter 经常被认为是一个体现了另一种基于动态解释语言的 Web 框架 Ruby on Rails 的性能问题的网站,但 Twitter 工程师表示,该框架的问题并不像他们早期做出的一些数据库设计选择那么严重。在。

Django 与 memcached 配合得很好,并提供了一些用于管理缓存的类,您可以在其中解决大部分性能问题。 您在线上提供的内容几乎比现实中的后端更重要 - 使用 yslow 这样的工具对于高性能 Web 应用程序至关重要。 您始终可以在后端添加更多硬件,但无法更改用户带宽。

The largest django site I know of is the Washington Post, which would certainly indicate that it can scale well.

Good design decisions probably have a bigger performance impact than anything else. Twitter is often cited as a site which embodies the performance issues with another dynamic interpreted language based web framework, Ruby on Rails - yet Twitter engineers have stated that the framework isn't as much an issue as some of the database design choices they made early on.

Django works very nicely with memcached and provides some classes for managing the cache, which is where you would resolve the majority of your performance issues. What you deliver on the wire is almost more important than your backend in reality - using a tool like yslow is critical for a high performance web application. You can always throw more hardware at your backend, but you can't change your users bandwidth.

ゞ花落谁相伴 2024-07-27 07:44:29

前一周我参加了 EuroDjangoCon 会议,这是几场演讲的主题 - 包括最大的基于 Django 的网站 Pownce 的创始人的演讲(幻灯片来自一场演讲 此处)。 主要信息是,您不必担心 Django,而是像适当的缓存、负载平衡、数据库优化等事情。Django

实际上对大多数这些事情都有钩子 - 特别是缓存,变得非常容易。

I was at the EuroDjangoCon conference the other week, and this was the subject of a couple of talks - including from the founders of what was the largest Django-based site, Pownce (slides from one talk here). The main message is that it's not Django you have to worry about, but things like proper caching, load balancing, database optimisation, etc.

Django actually has hooks for most of those things - caching, in particular, is made very easy.

静谧 2024-07-27 07:44:29

我确信您正在寻找更可靠的答案,但我能想到的最明显的客观验证是 Google 推动 Django 与其 App Engine 框架。 如果有人了解并定期处理可扩展性,那就是谷歌。 据我所知,最大的限制因素似乎是数据库后端,这就是为什么谷歌使用他们自己的......

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...

深居我梦 2024-07-27 07:44:29

正如高性能 Django Book 中所述
并浏览Cal Henderson

查看下面提到的更多详细信息:

听到人们的声音并不少见说“Django 无法扩展”。 根据你如何看待它,这个陈述要么完全正确,要么明显错误。 Django 本身无法扩展。

Ruby on Rails、Flask、PHP 或数据库驱动的动态网站使用的任何其他语言也是如此。

然而,好消息是 Django 与一套缓存和系统可以完美地交互。
负载平衡工具将允许它扩展到尽可能多的流量。

与您在网上读到的内容相反,
它可以做到这一点,而无需更换通常被标记为“太慢”的核心组件,例如数据库 ORM 或模板层。

Disqus 每月提供超过 80 亿次页面浏览量。 这些都是一些巨大的数字。

这些团队已经证明 Django 确实具有可扩展性。
我们在林肯环路的经验证明了这一点。

我们已经构建了大型 Django 网站,可以毫不费力地在 Reddit 主页上度过一整天。

Django 的扩展成功案例实在太多,无法一一列举。

它支持 Disqus、Instagram 和 Pinterest。 想要更多证据吗? Instagram 仅用 3 名工程师(其中 2 名没有后端开发人员)就能在 Django 上维持超过 3000 万用户

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

蓦然回首 2024-07-27 07:44:29

今天,我们使用许多网络应用程序和网站来满足我们的需求。 其中大多数非常有用。 我将向您展示其中一些由 python 或 django 使用的内容。

《华盛顿邮报》

《华盛顿邮报》的网站是与其日报配套的非常受欢迎的在线新闻来源。 其巨大的浏览量和流量可以通过 Django Web 框架轻松处理。
华盛顿邮报 - 5220 万独立访客(2015 年 3 月)

NASA

航天局的官方网站是查找有关其正在进行的太空探索的新闻、图片和视频的地方。 这个 Django 网站可以轻松处理大量的浏览量和流量。
每月 200 万访问者

《卫报》

《卫报》是一家英国新闻和媒体网站由卫报媒体集团提供。 它几乎包含了《卫报》和《观察家报》报纸的所有内容。 这些巨大的数据由 Django 处理。
卫报(评论系统) - 4160 万独立访问者(2014 年 10 月)

YouTube

我们都知道 YouTube 是上传猫视频的地方,但失败了。 作为现有最受欢迎的网站之一,它为我们提供了无尽的视频娱乐。 Python 编程语言为它和我们喜爱的功能提供了支持。

DropBox

DropBox 开启了在线文档存储革命,该革命已成为日常生活的一部分。 我们现在几乎所有东西都存储在云中。 Dropbox 允许我们使用 Python 的强大功能来存储、同步和共享几乎所有内容。

Survey Monkey

Survey Monkey 是最大的在线调查公司。 他们重写的 Python 网站每天可以处理超过一百万个回复。

Quora

Quora 是第一个在线提问并从个人社区获得答案的地方。 在他们的 Python 网站上,相关结果由这些社区成员回答、编辑和组织。

Bitly

Bitly URL 缩短服务和分析的大部分代码都是用 Python 构建的。 他们的服务每天可以处理数亿个事件。

Reddit

Reddit 被称为互联网的首页。 它是一个在线查找基于数千个不同类别的信息或娱乐的地方。 帖子和链接是用户生成的,并通过投票提升到顶部。 Reddit 的许多功能都依赖于 Python 来实现。

Hipmunk

Hipmunk 是一个在线消费者旅游网站,它比较顶级旅游网站,为您找到最优惠的价格。 这个 Python 网站的工具可让您找到目的地最便宜的酒店和航班。

点击此处了解更多:
25-of-the-最流行的 python 和 django 网站
什么是some-well-known-sites - 在 Django 上运行

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.

Washington Post

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)

NASA

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

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)

YouTube

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

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

Survey Monkey is the largest online survey company. They can handle over one million responses every day on their rewritten Python website.

Quora

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.

Bitly

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

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

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

凉城已无爱 2024-07-27 07:44:29

我认为我们不妨添加苹果 2011 年年度应用程序,

I think we might as well add Apple's App of the year for 2011, Instagram, to the list which uses django intensively.

贪恋 2024-07-27 07:44:29

是的,它可以。 它可以是带有 Python 的 Django 或 Ruby on Rails。 它仍然会扩展。

有几种不同的技术。 首先,缓存不是缩放。 除了硬件平衡器之外,您还可以拥有多个以 nginx 作为前端的应用程序服务器进行平衡。
为了在数据库方面进行扩展,如果您采用 RDBMS 方式,那么您可以在 MySQL / PostgreSQL 中使用读取从属设备。

Django 中高流量网站的一些很好的例子是:

  • Pownce(当它们还在那里时)。
  • Discus(通用共享评论管理器)
  • 所有报纸相关网站:华盛顿邮报等。

你可以感到安全。

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.

少女情怀诗 2024-07-27 07:44:29

以下是 Django 中构建的一些相对引人注目的内容的列表:

  1. The Guardian 的“调查你的 MP 开支”应用程序

  2. < p>Politifact.com(这里有一篇博客文章谈论(积极的)体验。网站赢得了普利策奖。

  3. 《纽约时报》代表应用

  4. EveryBlock

  5. Peter Harkins,WaPo 的程序员之一,列出了他们用 Django 构建的所有内容在他的博客上

  6. 有点老了,但是来自《洛杉矶时报》给出了他们为什么选择 Django 的基本概述

  7. 洋葱的 AV 俱乐部最近从(我认为是 Drupal)转移到了 Django。

我想其中一些网站每天的点击量可能会超过 10 万+。 Django 当然可以做到每天 10 万次点击甚至更多。 但是 YMMV 取决于您正在构建的内容,将您的特定站点放在那里。

Django 级别有缓存选项(例如,在 memcached 中缓存查询集和视图可以创造奇迹)及其他(上游缓存,例如 Squid)。 数据库服务器规格也将是一个因素(通常也是挥霍的地方),以及您对它的调整程度。 例如,不要假设 Django 会正确设置索引。 不要假设默认的 PostgreSQLMySQL 配置是正确的。

此外,如果速度较慢,您始终可以选择让多个应用程序服务器运行 Django,并在前面安装软件或硬件负载平衡器。

最后,您是否在与 Django 相同的服务器上提供静态内容? 您是否使用 Apache 或类似 nginxlighttpd? 您能负担得起使用 CDN 来获取静态内容吗? 这些都是值得思考的事情,但这一切都非常具有推测性。 每天 10 万次点击并不是唯一的变量:您想花多少钱? 您在管理所有这些组件方面拥有多少专业知识? 您需要多少时间将所有内容整合在一起?

Here's a list of some relatively high-profile things built in Django:

  1. The Guardian's "Investigate your MP's expenses" app

  2. Politifact.com (here's a Blog post talking about the (positive) experience. Site won a Pulitzer.

  3. NY Times' Represent app

  4. EveryBlock

  5. Peter Harkins, one of the programmers over at WaPo, lists all the stuff they’ve built with Django on his blog

  6. It's a little old, but someone from the LA Times gave a basic overview of why they went with Django.

  7. 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?

半窗疏影 2024-07-27 07:44:29

YouTube 的开发者倡导者在 PyCon 2012 上谈论了如何扩展 Python,其中也与缩放 Django 有关。

YouTube 拥有超过十亿用户,并且 YouTube 是基于 Python 构建的。

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.

护你周全 2024-07-27 07:44:29

我已经使用 Django 一年多了,它如何将模块化、可扩展性和开发速度结合起来,给我留下了深刻的印象。 与任何技术一样,它也有一个学习曲线。 然而,Django 社区提供的优秀文档让这个学习曲线变得不那么陡峭。 Django 能够很好地处理我扔给它的所有事情。 看起来它将能够很好地扩展到未来。

BidRodeo Penny Auctions 是一个中等规模的 Django 驱动的网站。 这是一个非常动态的网站,每天确实处理大量的页面浏览量。

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.

趁年轻赶紧闹 2024-07-27 07:44:29

请注意,如果您预计每天有 10 万个用户,并且每次活跃数小时(意味着最多 2 万个以上并发用户),那么您将需要大量服务器。 SO 拥有约 15,000 名注册用户,其中大多数可能不是每天活跃的。 虽然大部分流量来自未注册的用户,但我猜测他们中很少有人在网站上停留超过几分钟(即他们关注谷歌搜索结果然后离开)。

对于该容量,预计至少有 30 台服务器……每台服务器有 1,000 个并发用户,这仍然是一个相当大的数字。

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.

梦里寻她 2024-07-27 07:44:29

我对 Django 的经验很少,但我记得在 The Django Book 中有一章采访了运行一些较大的 Django 应用程序的人。 这是一个链接。我想它可以提供一些见解。

据报道,curse.com 是最大的 Django 应用程序之一,每月的页面浏览量约为 60-9000 万次。

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.

欢烬 2024-07-27 07:44:29

当今基于 Django 构建的“最大”网站是什么? (我主要通过用户流量来衡量大小)
Pinterest
disqus.com
更多信息请参见:https: //www.shuup.com/en/blog/25-of-the-most-popular-python-and-django-websites/

Django 能否每天处理 100,000 个用户,每个用户访问该网站几个小时?
可以,但要使用正确的架构、数据库设计、缓存的使用、负载平衡和多个服务器或节点

像 Stack Overflow 这样的网站可以在 Django 上运行吗?
是的,只需遵循第二个问题中提到的答案即可

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 or nodes

Could a site like Stack Overflow run on Django?
Yes just need to follow the answer mentioned in the 2nd question

零崎曲识 2024-07-27 07:44:29

我不认为问题真正与 Django 扩展有关。

我真的建议你研究一下你的架构,这将帮助你满足你的扩展需求。如果你犯了这个错误,那么 Django 的性能就毫无意义了。 性能!=规模。 您可以拥有一个具有惊人性能但无法扩展的系统,反之亦然。

您的应用程序数据库是否绑定? 如果是这样,那么你的规模问题也在那里。 您打算如何从 Django 与数据库进行交互? 当数据库处理请求的速度无法赶上 Django 接受请求的速度时,会发生什么情况? 当您的数据超出一台物理机器的容量时会发生什么。 您需要考虑您计划如何处理这些情况。

此外,当您的流量超过一台应用程序服务器时会发生什么? 在这种情况下,如何处理会话可能很棘手,通常您可能需要一个无共享的架构。 同样,这取决于您的应用程序。

简而言之,语言并不是决定规模的因素,语言负责性能(同样取决于您的应用程序,不同的语言表现不同)。 您的设计和架构使扩展成为现实。

希望对您有所帮助,如果您有疑问,我很乐意为您提供进一步帮助。

I don't think the issue is really about Django scaling.

I really suggest you look into your architecture that's what will help you with your scaling needs.If you get that wrong there is no 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 lay 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 would 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.

腹黑女流氓 2024-07-27 07:44:29

另一个例子是rasp.yandex.ru,俄罗斯运输时刻表服务。 它的出席满足您的要求。

Another example is rasp.yandex.ru, Russian transport timetable service. Its attendance satisfies your requirements.

何以心动 2024-07-27 07:44:29

如果您的网站包含一些静态内容,则将 Varnish 服务器放入前面将显着提高你的表现。 即使是单个盒子也可以轻松输出 100 Mbit/s 的流量。

请注意,对于动态内容,使用 Varnish 之类的东西会变得更加棘手。

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.

望她远 2024-07-27 07:44:29

我使用 Django 为爱尔兰国家广播公司开发高流量网站。 这对我们来说效果很好。 开发高性能网站不仅仅是选择一个框架。 框架只是系统的一部分,其强度取决于其最薄弱的环节。 如果问题是数据库查询缓慢或服务器或网络配置不当,那么使用最新的框架“X”将无法解决您的性能问题。

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.

猫弦 2024-07-27 07:44:29

问题不在于 django 是否可以扩展。

正确的方法是了解并了解哪些网络设计模式和工具可以放在 django/symfony/rails 项目下以实现良好的扩展。

一些想法可以是:

  • 多路复用。
  • 反向代理。 例如:Nginx、Varnish
  • Memcache 会话。 例如:
  • 在您的项目和数据库上进行 Redis 集群以实现负载平衡和容错:例如:Docker
  • 使用第三方来存储资产。 例如:Amazon S3

希望它能有所帮助。 这是我山上的小石头。

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.

暖风昔人 2024-07-27 07:44:29

尽管这里有很多很好的答案,但我只是想指出,没有人强调......

这取决于应用程序

如果您的应用程序写入较少,如您从数据库中读取的数据比写入的数据多得多。 那么扩展 django 应该是相当简单的,哎呀,它带有一些相当不错的开箱即用的输出/视图缓存。 利用这一点,比如说,将 redis 作为缓存提供程序,在其前面放置一个负载均衡器,启动 n 个实例,您应该能够处理非常大量的流量。

现在,如果您必须每秒进行数千次复杂的写入? 不同的故事。 Django 会是一个糟糕的选择吗? 好吧,不一定,取决于您如何构建解决方案,以及您的要求是什么。

只是我的两分钱:-)

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 :-)

a√萤火虫的光℡ 2024-07-27 07:44:29

如果您想使用开源,那么有很多选择供您选择。 但 python 是其中最好的,因为它有很多库和一个超级棒的社区。
以下是一些可能会改变您想法的原因:

  • Python 非常好,但它是一种解释性语言,这使得它很慢。 但是有许多加速器和缓存服务部分解决了这个问题。

  • 如果您正在考虑快速开发,那么 Ruby on Rails 是最好的选择。 该(ROR)框架的主要座右铭是为开发人员提供舒适的体验。 如果您比较 Ruby 和 Python,两者的语法几乎相同。

  • Google App Engine 是非常好的服务,但它会将您束缚在其范围内,您没有机会尝试新事物。 您可以使用 Digital Ocean 云来代替它,只需每月 5 美元费用最简单的水滴。 Heroku 是另一项免费服务,您可以在其中部署您的产品。

  • 是的! 是的! 您听到的完全正确,但这里有一些使用其他技术的示例

    • Rails:Github、Twitter(以前的版本)、Shopify、Airbnb、Slideshare、Heroku 等。
    • PHP:Facebook、维基百科、Flickr、Yahoo、Tumbler、Mailchimp 等。

结论框架或语言并不能为你做所有事情。 更好的架构、设计和策略将为您提供一个可扩展的网站。 Instagram就是最大的例子,这个小团队正在管理如此庞大的数据。 这是一篇关于其架构的博客,必须阅读。

If you want to use Open source then there are many options for you. But python is best among them as it has many libraries and a super awesome community.
These are a few 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 the same syntax.

  • 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 the biggest example, this small team is managing such huge data. Here is one blog about its architecture must read it.

烟酒忠诚 2024-07-27 07:44:29

您绝对可以在 Django 中运行高流量站点。 查看这篇 Django 1.0 之前版本但仍然相关的帖子:http:// menendez.com/blog/launching-high-performance-django-site/

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/

旧情别恋 2024-07-27 07:44:29

查看这个名为 EveryBlock 的微型新闻聚合器。

它完全是用 Django 编写的。 事实上他们是 Django 框架本身的开发者。

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.

昇り龍 2024-07-27 07:44:29

一旦您的站点/应用程序开始增长,就需要均匀地分散任务,简而言之,优化每个方面,包括数据库、文件、图像、CSS 等,并平衡与其他几个资源的负载。 或者你留出更多的空间让它生长。 大型网站必须实施 CDN、云等最新技术。 仅开发和调整应用程序不会让您满意,其他组件也发挥着重要作用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文