20 ms·
Is anyone else kind of shocked in 2016 that a webserver for a language can only serve 10 requests per second? I agree that a super optimized stack that can serv
by brianwawok 11y ago
Is anyone else kind of shocked in 2016 that a webserver for a language can only serve 10 requests per second? I agree that a super optimized stack that can serve 15k requests per second is a bit much for hobby projects but 10? If 1 user pulls up a page with a bunch of images, he has a 3 second wait to get everything. Sure you can static host some stuff with nginx.... but still.
- geerlingguy 11y agoKeep in mind this was running on a beta; the current version of Drupal 8, running on PHP 7, gets something closer to 60 req/s authenticated, 300+ anonymous.
- nkozyra 11y agoEven so, that strikes me as very low. I've always wondered where the bottlenecks are in Drupal (I haven't looked at it in many years). Getting that kind of throughput even on paltry hardware would give me pause about doing this in production.
- emergentcypher 11y ago- PHP is slow. Unlike JS, it's generally interpreted and not JIT (unless you're Facebook). - Drupal has to bootstrap itself and all modules on every request. - Drupal makes waaaaay too many SQL queries - Drupal generates horribly performing SQL queries
- brianwawok 11y agoHow many SQL queries end up getting run if you are loading a simple page with 1 row read out of 1 table as the actual payload?
- knieveltech 11y agoThat never happens though. Drupal has to bootstrap itself so it loads it's registry cache, variables cache, current user record (split across at least four tables to pull in the user account, associated roles, and user access permissions), any dynamic menu builds are going to the menu table, access callbacks and other function calls associated with dynamic menu rendering may also trigger other database calls, uncached content blocks have to be pulled out of the database, and we haven't even gotten to loading the node for the page which could be split across a bunch of tables if the content type has fields added to it...
- epimetheus 11y agoPHP isn't that slow[0] by itself. Notice it's 10th on the list (Php5-raw), it outperforms Nodejs, Python, RoR and many others. Drupal, on the other hand, is so slow because it has a terrible architecture. [0] - https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/
- ausjke 11y agoDoes it have anything to do with symphony used in D8? or D7 is the same bad? I used D5/D6/D7 for a low-traffic site these years.
- knieveltech 11y agoI'm kind of enjoying watching the developer community turn on Drupal like a pack of wolves. That said, aren't performance issues more or less unavoidable when you're dealing with a CMS? The scope of use cases they try to cover is pretty wide which is sure to lead to bloat.
- epimetheus 11y agoI deal with Drupal (7.x) on a daily basis, so that's why you'll probably detect bitterness from me. Personally there are a myriad of reasons why Drupal rubs me the wrong way, most are Developer issues though (Such as their annoying comment form API, and arrays, arrays everywhere). There are better CMSs out there, IMO, but we have to use Drupal because it's the only one that has a Certification of Networthiness (I work in the DOD) - and to make things worse for us, we have to use Drupal on IIS with MSSQL (for now). Why can't we just go with Umbraco (.Net)!?
- knieveltech 11y agoI've been working with Drupal professionally since 4.7, have code in several contributed modules in D6 and D7, and used to organize the local Drupal User's Group. I know all about the bitterness. I've spent the last 10 years watching a lightweight and infinitely hackable CMS turn into a bloated morass of opinionated overweight APIs that make easy things complicated. Yeah I'm looking at you renderable arrays. Anyway I'm counting the minutes until an Acquia PM spots this post and starts spraying down the comments section with 35 paragraph word salad breathlessly defending the heroic efforts of the core dev team to drag D8 into the 21st century, in the process entirely missing the point that this may very well be the first core release of Drupal that will not run on commodity hosting due to resource requirements.
- dallbee 11y agoPHP's speed is here is a bit of a red herring. I dislike linking to benchmarks, but https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=db https://www.techempower.com/benchmarks/#section=data-r12&hw=.... In I/O bound situations, PHP performs within an order of magnitude of C. You don't have to be Facebook, you literally just need to enable APC or XCache. Let's focus on how horribly awful Drupal is. Or, to the point of the topic, let's congratulate the author for discovering that yes, you can in fact replace a single server with any number of cheaper computing devices (you just have to disregard all of the other reasons why we use servers).
- deleted 11y ago[deleted]
- aasarava 11y agoI'm an independent developer. The majority of my clients are on Drupal. Here's what I've learned: While it's true that someone looking at Drupal's architecture for the first time is likely to say, "Whaaaa? Why, why, why?", the truth is that a lot of the decisions start to make sense once you need a CMS for more than a basic blog. For example, the reason there are so many joins just to retrieve all the fields of data for a page is that Drupal allows each field to be shared across different content types, or to have different revisions, or even to have different translations from other fields on the same page. Yes, this is going to feel awkward and slow if all you need is a simple blog post table with one post per row. But if your site is complicated enough or has enough traffic, chances are that you're going to start relying on caching to help out, no matter what CMS you use. Drupal's no different. There's its own internal caching (which bypasses most of the queries for anonymous users), PHP's APC caching (which gets over the PHP loading hurdle), memcache (to bypass queries for logged in users), and Varnish (bypassing Drupal altogether for static content.)
- nkozyra 11y agoI know it's been mentioned above, but PHP is very much not slow on its own. On that particular benchmark it's the highest interpreted language on the list (same with single query, fortunes and data updates). In fact, despite some atrocious language design, speed hasn't been a problem in a long time. And that's just PHP5, PHP7 offers claims of 100% speedup, not to mention HHVM. I would wager that the typical bottlenecks are where the slowdowns are happening, and your hints about the # and types of queries would be my first guess.
- owyn 11y agoDrupal isn't alone here. Mediawiki without caching does some horrible stuff. I just loaded a random page (with caching turned off) that does 1874 database queries. For one page. That it still loads in 7 seconds is a miracle.
- JasuM 11y agoThat's not the server's fault, it's just Drupal being slow. It was pretty slow in version 6 and has been getting consistently slower. I'm pretty sure that the request count is for dynamic content only.
- at-fates-hands 11y ago>> That's not the server's fault, it's just Drupal being slow. Agreed. I had a static site running on Drupal 7 on Azure and it was really slow. I did a ton of optimizing the front-end code and caching everything I could and it still took between 3-5 seconds to serve pages. Once I switched to a static site generator, I was floored at how much faster the pages loaded and the performance was night and day; and I was still hosting it on Azure. The only variable that had changed was Drupal.
- aidos 11y agoSurely the only variable that changed was the entire stack? I'm assuming your static generator basically means you're firing a bunch of bytes, probably sitting in RAM out over a socket. No CPU/processing involved, no dynamic anything. I'll be the last person to defend Drupal, but I don't think it's fair to say that Drupal was the only variable that changed. What about the amount of stuff coming off disk each time, the removal of an interpreted language, the database access?
- tenementfunster 11y ago>> I had a static site running on Drupal 7 on Azure and it was really slow. I did a ton of optimizing the front-end code and caching everything I could and it still took between 3-5 seconds to serve pages. horseshit
- ausjke 11y agoWhile drupal is slow, it is a CMS. How do you do CMS with static html pages? e.g. authentication, classify the content for various access rights, serving dynamic book-module/forum/wiki/nodes/editor/video etc? I'm not impressed by Drupal's preformance even on a low-traffic site, but then again I could not find a "better" CMS yet.
- emergentcypher 11y agoDrupal has always performed like shit. 10/sec is actually pretty good for Drupal It's only good for managing static content, the only way you get any sort of performance out of it is super aggressive caching. PHP is a slow abomination. The entirety of Drupal and all modules have to be bootstrapped and run on every request. It runs far too many SQL queries and those queries look atrocious (nested selects, tons of joins, etc). Same with Magento Commerce. I was always shocked at just how slow it is.
- onli 11y agoIt gets pointed out below, but I think that is really important. > PHP is a slow abomination. The entirety of Drupal and all modules have to be bootstrapped and run on every request. It runs far too many SQL queries and those queries look atrocious (nested selects, tons of joins, etc). Those statement don't go together. If it is drupal that is doing too many requests, that is not the fault of PHP. I'm working partly on an PHP open source blog engine and we are getting way better results. Though caching also helps there, as soon as the SQL statements are properly cached performance increases a lot. That will be true for Drupal, but it most likely will be true for any other CMS that has an equvalent workload on every request. And that those caches help actually show that PHP is not at fault.
- yxlx 11y agoI think the way to read that paragraph is as two separate statements. >PHP is a slow abomination. The entirety of Drupal and all modules have to be bootstrapped and run on every request. and >It runs far too many SQL queries and those queries look atrocious (nested selects, tons of joins, etc). So the first part is about slowness due to how PHP is usually run. The second part is about slowness due to the implementation of Drupal. When I say "how PHP is usually run", I mean that strictly speaking one could probably write PHP in a way such that there is one part which comprises all the things that take most of the time to load and have this run standalone. However, I think going to such extents might be more work to do in PHP compared to picking another language. Then again, I haven't written PHP for several years and even when I did I never did any advanced stuff so for all I know what I'm saying here might be something PHP professionals have already thought of.
- manarth 11y agoThat'll be 10 drupal requests (invoking PHP, all the Drupal stack, DB queries, etc). The static assets will be served directly by the webserver, without invoking Drupal, without any of that overhead.