News for hackers. Stuff that matters.
Re:Wikipedia is swimming in money–why is it begging people t... by marcan_42 on Monday May 31, 2021 @02:27AM (#27340869)
Did you read their article? They mention how money they funnel into the fund is counted as "expenses", as is stuff like hiring 40 people just for fundraising. I have no doubt they could keep the website up and maintained on something of the order of $10m/year.
Re:Wikipedia is swimming in money–why is it begging people t... by soco on Monday May 31, 2021 @03:59AM (#27341442)
Because all Wikipedia needs to do is to keep the website up, yes... This sounds pretty much similar with the argument on which the education system gets constantly defunded.
Re:Wikipedia is swimming in money–why is it begging people t... by saurik on Monday May 31, 2021 @05:43AM (#27342217)
Funding Wikipedia's side projects--like wiktionary--doesn't seem particularly valuable; Wikipedia doesn't spend much money actually improving Wikipedia, and what effort they have put in was spent on things like the "visual editor" project that both their own surveys and studies showed wouldn't actually improve editing.
Re:Wikipedia is swimming in money–why is it begging people t... by zozbot234 on Monday May 31, 2021 @05:51AM (#27342280)
Wiktionary indirectly supports translation work that benefits Wikipedia, and provides a place to work on non-encyclopedic content that should not be in Wikipedia itself.
Re:Wikipedia is swimming in money–why is it begging people t... by saurik on Monday May 31, 2021 @06:14AM (#27342424)
> provides a place to work on non-encyclopedic content that should not be in Wikipedia itself

I don't think I agree with you at all here, given that I grew up wanting the Hitchiker's Guide to the Galaxy and Wikipedia refuses to offer it... seemingly in no small part because the founder of it makes money off of Wikia.

But, I believe regardless: if someone goes to an encyclopedia and is told "this encyclopedia needs your help: it is going to run out of money unless you donate to it", and you take that money to do something that isn't to improve that encyclopedia, that is absolutely unethical, no matter how useful it might be on its own.

> Wiktionary indirectly supports translation work that benefits Wikipedia

This alone might be somewhat fair (though I find it hard to believe, honestly); but, I still challenge whether someone who comes to the website and is shown the current banner would believe their money isn't being flitted away on things that don't benefit the resource they were using, even if it might be "more ethical" to provide better translations.

Re:Wikipedia is swimming in money–why is it begging people t... by ratww on Monday May 31, 2021 @06:40AM (#27342584)
The Wikia part is a very important point.

At some point in the last 10 years Wikipedia managed to purge as much content as it could about fiction because this was Wikia's turf. There was just an order from above and overzealous mods willing to do the work, even when the content wasn't readily available.

Now the content is in a website that's closed, slow as hell, littered with ads, tracking and autoplaying video.

Maybe Wikia should be the one footing the whole bill for Wikipedia, instead of Wikipedia spending 12% of donation money on fundraisers.

Re:Wikipedia is swimming in money–why is it begging people t... by zozbot234 on Monday May 31, 2021 @06:52AM (#27342641)
They purged content about fiction because it was pointless cruft, often had no independent references, and was generally indistinguishable from undue promotion/advertising of said fiction. The increased focus on stuff that's neutral and properly verifiable seems to have been good for Wikipedia itself.
Re:Wikipedia is swimming in money–why is it begging people t... by denton-scratch on Monday May 31, 2021 @12:48PM (#27345920)
Does it "indirectly pay" translators? Or are they in fact volunteers?
Re:Wikipedia is swimming in money–why is it begging people t... by jpxw on Monday May 31, 2021 @05:59AM (#27342331)
Wiktionary is an incredibly useful resource
Re:Wikipedia is swimming in money–why is it begging people t... by saurik on Monday May 31, 2021 @06:10AM (#27342397)
Well, get this: I agree! As someone who studies linguistics, I find Wiktionary really useful... and yet, it frankly isn't what any of the people who are donating to Wikipedia think their money is being used on, given the banner on their site. It is unethical to ask for money to run Wikipedia and then spend that money on other projects, no matter how useful they might be. If you want to do that, the banner should say "we are so glad you are getting value out of Wikipedia! don't worry: Wikipedia is safe; but... we have so many other ideas for how to improve the world, and would love you forever if you helped us achieve those dreams by donating money to our parent foundation, Wikimedia, to spend on others initiatives!". Of course, I bet almost no one would donate then.
Re:Wikipedia is swimming in money–why is it begging people t... by soco on Monday May 31, 2021 @07:01AM (#27342701)
I cannot tell what the banner shows in your region, but what I see right now in front of me says "Your donation allows billions of people to access important information on Wikipedia and other Wikimedia platforms every day.".
Re:Wikipedia is swimming in money–why is it begging people t... by CRConrad on Monday May 31, 2021 @06:47PM (#27348931)
That should arguably be only "other Wikimedia platforms"; no mention of Wikipedia at all, since that is more than covered already. So mentioning WP even before the others seems way different from what the GP said.
Re:Wikipedia is swimming in money–why is it begging people t... by kevinwang on Monday May 31, 2021 @10:18AM (#27344324)
I haven't seen those surveys, (and I'm not much of a Wikipedia editor) but anecdotally, the visual editor seems to me like an obvious and long overdue direction forward.
Re:Wikipedia is swimming in money–why is it begging people t... by 6510 on Monday May 31, 2021 @06:56AM (#27342675)
Not at all, all parts of education should be fully funded. Either pay everyone working on a project or have volunteers do it. Anything in between I wont contribute nor donate to.
Re:Wikipedia is swimming in money–why is it begging people t... by Wowfunhappy on Monday May 31, 2021 @06:43AM (#27342603)
I agree with you, however:

> Please don't comment on whether someone read an article. "Did you even read the article? It mentions that" can be shortened to "The article mentions that."

https://news.ycombinator.com/newsguidelines.html

Re:Wikipedia is swimming in money–why is it begging people t... by paxys on Monday May 31, 2021 @03:47AM (#27341360)
> I have no doubt they could keep the website up and maintained on something of the order of $10m/year.

What exactly are you basing this on?

Re:Wikipedia is swimming in money–why is it begging people t... by colonwqbang on Monday May 31, 2021 @04:10AM (#27341512)
Here's their budget for 2020

https://meta.m.wikimedia.org/wiki/Wikimedia_Foundation_Mediu...

They budgeted $5M for "data centre expenses". We cannot know for sure how much it would really cost if WMF only focused on running their website. But $10M doesn't sound implausible to me.

Re:Wikipedia is swimming in money–why is it begging people t... by croes on Monday May 31, 2021 @05:14AM (#27341987)
If WMF would only run the website, the content would only be advertisment and propaganda.
Re:Wikipedia is swimming in money–why is it begging people t... by ectopod on Monday May 31, 2021 @06:08AM (#27342382)
Are you sure? There are about 1100 unpaid administrators.
Re:Wikipedia is swimming in money–why is it begging people t... by 6510 on Monday May 31, 2021 @06:58AM (#27342682)
Which is a thankless job.
Re:Wikipedia is swimming in money–why is it begging people t... by CRConrad on Monday May 31, 2021 @06:49PM (#27348944)
Sure, but what does that gave to do with anything?
Re:Wikipedia is swimming in money–why is it begging people t... by 6510 on Tuesday June 01, 2021 @10:21PM (#27364048)
That if you are going to pay a sub set in a mostly volunteer project it [imho] should be the most shitty tasks. Improved moderation would dramatically improve the wiki as people are quick to leave if the mod is unable to do the work required.
Re:Wikipedia is swimming in money–why is it begging people t... by detaro on Monday May 31, 2021 @07:41AM (#27342999)
How much does WMF spend to prevent the content being "only be advertisment and propaganda"?
Re:Wikipedia is swimming in money–why is it begging people t... by jeltz on Monday May 31, 2021 @06:28AM (#27342493)
But WNF does not emoloy any moderators so I am sure Wikipedia would do fine.
Re:Wikipedia is swimming in money–why is it begging people t... by hugi on Monday May 31, 2021 @05:45AM (#27342235)
That's what some people want. They're horrified there's a free platform providing useful content, where they can't profit off people's work.
Re:Wikipedia is swimming in money–why is it begging people t... by AmericanChopper on Monday May 31, 2021 @06:03AM (#27342358)
Your comment would make sense if moderating wikipedia cost that extra $102,000,000 we’re talking about. But it doesn’t.

Wikimedia has one project I’m slightly interested in, and spends most of their money on other projects that I’m completely uninterested in, and would personally consider to be largely a useless waste of time. They aggressively fundraise with a message that implies their single product that everybody cares about is financially imperilled. In reality, if they’d been run responsibly, the one valuable thing they produce could have already been financially secured for decades into the future.

I really just don’t care about what they spend most of their money on, I think they’re deceitful in the way that they fundraise, and all I hope is when all of their side projects eventually fail, that their core product survives in some form.

Re:Wikipedia is swimming in money–why is it begging people t... by SpelingBeeChamp on Monday May 31, 2021 @07:05AM (#27342729)
What are the “other projects” you are referring to?
Re:Wikipedia is swimming in money–why is it begging people t... by AmericanChopper on Monday May 31, 2021 @07:28AM (#27342889)
Everything on this list that isn’t Wikipedia, along with essentially all of the research they fund.

https://meta.m.wikimedia.org/wiki/Complete_list_of_Wikimedia...

You don’t have to put it in air quotes like you’re making some sort of point. Calling everything they fund a “project” is the language Wikimedia use in their budgets and governance documentation.

If you were actually having trouble thinking of a single project they operate other than Wikipedia, then perhaps you might also have some questions about what they do with 90% of their revenue.

Re:Wikipedia is swimming in money–why is it begging people t... by SpelingBeeChamp on Wednesday June 02, 2021 @10:42AM (#27369246)
You are reading way too far into what I wrote. I was only asking a question. The “air quotes” were quotes. Because I was quoting you, and that’s when you’re supposed to use them. Like above.

Thank you for the link. I was unaware.

Re:Wikipedia is swimming in money–why is it begging people t... by AmericanChopper on Thursday June 03, 2021 @04:02AM (#27378410)
Using quotation marks in that fashion is widely understood that is has its own wikipedia page (though they have a different name in print).

https://en.m.wikipedia.org/wiki/Scare_quotes

But don’t worry. I’m sure you really were just “quoting [me]”.

Re:Wikipedia is swimming in money–why is it begging people t... by thoughty on Monday May 31, 2021 @04:07AM (#27341493)
I would be very surprised if their spend was just $10M/year on their tech infra. That's very low. I expect it would be much higher.

PS: I work for cloud computing company and have insight on how much costs increase with scale.

edit: fixed typos.

Re:Wikipedia is swimming in money–why is it begging people t... by jiggawatts on Monday May 31, 2021 @04:22AM (#27341592)
Wikipedia is hosted on ordinary rackmount servers at a handful of colocation facilities: https://meta.wikimedia.org/wiki/Wikimedia_servers

It does not significantly use cloud services, and as you can see by the picture of their racks, they use standard 1 RU pizzaboxes. Their workload is highly scalable horizontally, and doesn't even need much in the way of expensive "enterprise" hardware such a SAN arrays: https://upload.wikimedia.org/wikipedia/commons/thumb/c/ca/Wi...

If you buy beige box rackmount hardware with basic compute and CPU, it's pretty easy to spend less than $250K per rack, and the hardware can be kept for 5+ years. That's about 50K per rack per year. Double that for opex, and assume twenty racks distributed across a a handful of sites for capacity and availability. That's just $2M per annum.

Keep in mind they're a high-profile charity, so they get discounts and tax breaks.

(I'm not saying that's all there is to Wikipedia! There's software development, management, finance, etc... I'm just saying that the infrastructure alone is probably less than you think.)

PS: English Wikipedia gets about 250M page views per day, which is only about 3,000 per second. If they used an efficient language instead of PHP, that's well within the capability of a single modern server! There have been comments along these lines made in other forums, and the response was that it would cost more to rewrite the software than the maintain the hardware required for PHP. I don't remember the numbers, but I vaguely remember tens of millions for a rewrite, a high risk of breaking issues, and a significantly lower hardware cost.

Re:Wikipedia is swimming in money–why is it begging people t... by zozbot234 on Monday May 31, 2021 @05:05AM (#27341921)
> It does not significantly use cloud services

They do host their own private "cloud", mostly used for research and project development.

> English Wikipedia gets about 250M page views per day, which is only about 3,000 per second. If they used an efficient language instead of PHP, that's well within the capability of a single modern server!

Nitpicking, page views from outside users are not supposed to hit PHP at all - those requests should be served by their caching layer. But yes, you're correct that they're relying on quite a bit of legacy tech from their early days, not just PHP but MariaDB as well even though many enterprises would now rely on Postgres wrt. these use cases. I suppose that they could rewrite the stuff piecemeal, and recent developments in PHP itself would make it easier. (Some things have been rewritten already, notably the wikitext parser. That's clearly one thing where you would want to avoid breakage at all costs, but they did get it done.)

Re:Wikipedia is swimming in money–why is it begging people t... by vosper on Monday May 31, 2021 @05:37AM (#27342172)
> But yes, you're correct that they're relying on quite a bit of legacy tech from their early days, not just PHP but MariaDB as well even though many enterprises would now rely on Postgres wrt.

Postgres is great and all, but there’s really nothing wrong with relying on MariaDB or MySQL for what Wikipedia is doing.

Re:Wikipedia is swimming in money–why is it begging people t... by bawolff on Monday May 31, 2021 @12:10PM (#27345501)
> Some things have been rewritten already, notably the wikitext parser

The new parser is being rewritten in php in order to be integrated with the rest of the php code.

Re:Wikipedia is swimming in money–why is it begging people t... by lozenge on Monday May 31, 2021 @05:31AM (#27342136)
My information might be ten years out of date, but the vast majority of page views never hit PHP. If you are viewing a even slightly popular article and aren't logged in, your request is served by a Varnish cache.
Re:Wikipedia is swimming in money–why is it begging people t... by afc on Monday May 31, 2021 @06:49AM (#27342633)
> English Wikipedia gets about 250M page views per day, which is only about 3,000 per second. If they used an efficient language instead of PHP, that's well within the capability of a single modern server!

This type of comment betrays a complete lack of knowledge about how large scale internet systems operate (which is something I've worked on for the last 10+ years) and comes across as incredibly naive. I can immediately point out huge flaws in your thinking:

* You're assuming that traffic is constant through the day (that you can divide daily traffic rate to get a sense of daily peak; or, in other words, you provision for mean usage, not peak)

* You're ignoring the problems of unpredictable hotspots (single articles suddenly becoming orders of magnitude more popular than the median in relatively unpredictable and spikey ways; think World Cup final or major earthquake)

* You're not reserving any safety margins for unexpected traffic growth, so you'd likely run into cascading failures

* You're assuming that the entirety of Wikipedia can be held in ram. Including all the history and such. Or, if not, that a single server has enough drives that spindle capacity won't be a problem.

* You're not even considering networking/bandwidth costs. How many network cards would your server need?

* You're ignoring any problems with replication/redundancy (e.g., no backups?) so your site would be a nightmare in reliability terms. Of course, once you do that, you'll need to reason about consistency problems.

I think your logical fallacy is that you're thinking that because your can't understand something (that running Wikipedia could cost so much), it must mean that the thing you can't understand isn't true. Instead, I'd suggest that you'd get further by focusing on discovering the limits of your understanding and genuinely asking yourself: "How could it be that it costs so much? What may I be missing?"

Re:Wikipedia is swimming in money–why is it begging people t... by jiggawatts on Monday May 31, 2021 @07:42AM (#27343006)
Oh don't get me wrong, I'm not saying I would host a site like Wikipedia on a single server, I'm saying that it's more than possible.

Also, don't assume I'm speaking from a position of ignorance here, I know more than a little about how Wikipedia works. I've perused the source, played with the database dumps, etc...

I find comments like yours amusing, because I hear similar things in the industry all the time! People like you are not wrong, it's just that correct knowledge is very rapidly outdated in this industry. It's shocking what exponential growth really means! As a random example, I once had an engineer going on and on about their "powerful" email server that cost them six figures. I pointed out that it was slower than the Blackberry phone it was synchronising the email to. (No, really!)

You really underestimate the spec of a modern, 2021 era server!

You really are.

You can buy, right now, for "normal" money, a server with two 64-core AMD EPYC CPUs. That's 128 cores that are the fastest individually of pretty much any server CPU. This platform provides 256 hardware threads. Right there, you're looking at something like 12 requests per second per thread. As long as you can serve them in under 85 milliseconds each on average, that's plenty!

I've written a Wikipedia clone for an in-house CMS. The content generation was so fast that for laughs I compiled it to javascript and had it run per keystroke for a live preview in the browser. This worked fine for content up to about 64 KB. This was in 2008, by the way. Things have moved on in terms of performance. Try this with Rust and some judicious use of high-performance AVX-enhanced parsers, and you could generate a typical Wikipedia page in under 10 ms, no sweat. Then there's output caching to get it even lower...

That server can have something like 4 TB of memory in it. The entire Wikipedia database is just 5.6 TB uncompressed.

Yes, you really can fit most of Wikipedia in memory!

Bandwidth? Mellanox makes 200 Gbps Ethernet cards. They're dual port, so that's 400 Gbps. That's enough to handle the bandwidth of a decent sized regional telecommunications company through a single box. I should know, I've seen the network diagram of mine, and they have only 100 Gbps inter-city links!

Spindles!? Are you kidding me? There are gaming PCs being built right now with 2 TB NVMe drives in them that can individually put out 7 GB/s and 1M IOPS! Who the hell puts servers on spinning rust in this day and age? That lone, single NVMe drive is putting out 56 Gbps by itself. Throw in a smidge of caching, and it could saturate those aforementioned 2x200 Gbps ports.

So no, I would not put the entirety of Wikipedia on just one server, that would be silly.

I would put it on two.

Okay, maybe three, for redundancy. Just in case.

Re:Wikipedia is swimming in money–why is it begging people t... by BeefWellington on Monday May 31, 2021 @09:22AM (#27343807)
> Oh don't get me wrong, I'm not saying I would host a site like Wikipedia on a single server, I'm saying that it's more than possible.

This is incorrect. Many of the numbers you throw out ignore that in order to serve its content a server must do some work, which requires both CPU time and memory. Assuming you were able to eliminate hard drives and fit everything into RAM, you still have the problem that to serve requests and do that work you need RAM.

>That server can have something like 4 TB of memory in it. The entire Wikipedia database is just 5.6 TB uncompressed. >Yes, you really can fit most of Wikipedia in memory!

This is incorrect. According to Wikimedia[2], the entire uncompressed size of Wikipedia is 19TB as of 2019, and the site has grown since.

Talking specifically about hard drives:

> Spindles!? Are you kidding me? There are gaming PCs being built right now with 2 TB NVMe drives in them that can individually put out 7 GB/s and 1M IOPS! Who the hell puts servers on spinning rust in this day and age? That lone, single NVMe drive is putting out 56 Gbps by itself. Throw in a smidge of caching, and it could saturate those aforementioned 2x200 Gbps ports.

Firstly, gaming PCs are almost always ahead of the curve when it comes to performance on everything.

Secondly, to your question about who puts servers on spinning rust -- Pretty much everyone. Backblaze even releases HDD reliability ratings[1] based on what they observe in terms of the spinning platter drives.

Also, your 2TB NVMe drive is going to cap out at around a quarter of what the large-spindle raid controller can, and you can have a few of those in each system if you want. Sure, a PCIe 4.0 NVMe drive is going to get you 7.88GB/s in your motherboard slot but a PCIe 4.0 raid controller can have four times that bandwidth available to it.

But for argument's sake let's say you decided to swap out your raid controller for a PCIe 4.0 card that does NVMe and has onboard raid (these don't exist for purchase yet that I can find at my usual suppliers but I imagine they're coming). Now you have a size problem. The largest current best available SSDs are Sabrent's 8TB PCIe 3.0 drives. This will cut the performance considerably but is probably the sweet spot for size & speed. You need 4 of them just to host current Wikipedia, limiting any growth, and certainly without factoring in any other parts of the system that may take away from the operation.

For comparison's sake to the 2TB NVMe drive in your example, my old homelab can hit 5 GB/s on five spindles that I bought in ~ 2011-12 and they're all old and cheap, not enterprise-grade gear.

> So no, I would not put the entirety of Wikipedia on just one server, that would be silly.

> I would put it on two.

> Okay, maybe three, for redundancy. Just in case.

Then you have issues of bandwidth by having so few connections, as well as the poor user experience of trying to visit a site that exists and is served in only three places (hopefully around the globe). It's also bad for reliability because if any one site loses its connection suddenly your 200GB/s traffic is pushed onto the other servers. If you want a sense for how reliability engineering works you should look at how Netflix does testing and why they've managed to withstand regional AWS outages despite being hosted on AWS[3].

Wikimedia lays out their system set up pretty well on their own page[4].

Could you technically host wikipedia on your own systems? Sure, lots of people do, go visit Reddit's r/datahoarders and I'm sure you can find more than a few who have their own local copies. Could you actually replace production wikipedia on the Internet with the setup you describe? No, you cannot.

I also suspect you haven't costed out the server setup you describe, as it seems incongruous to say that they spend too much while advocating replacing their entire server stack with cutting edge hardware (and will they need to do so annually in order to keep up?).

[1]: https://www.backblaze.com/blog/backblaze-hard-drive-stats-fo...

[2]: https://meta.wikimedia.org/wiki/Data_dumps/Dumps_sizes_and_g...

[3]: https://netflixtechblog.com/lessons-netflix-learned-from-the...

[4]: https://meta.wikimedia.org/wiki/Wikimedia_servers

Re:Wikipedia is swimming in money–why is it begging people t... by jiggawatts on Monday May 31, 2021 @08:07PM (#27349444)
Obviously I'm not being serious about hosting Wikipedia on just 3 servers. That would be a nightmare for maintenance and availability management. My point is that you could physically host their content on just one server, and nothing you have said counters that.

Who cares if Blackblaze -- a backup company -- uses hard drives? Of course they do! They're not hosting Wikipedia though. My point was by using current-generation COTS hardware, it is entirely possible to host a huge website on a single box. It is. It really is. This is not about what other people generally do. This is about what is possible!

You keep getting bogged down by the practicalities of real-world site management. For the sake of argument, if I were to engineer a serious solution for this problem, I would be looking at hardware more like what Cloudflare uses for their edge cache boxes. They did the legwork to find the sweet spot for price/performance. This is typically a single-socket server with a 48-core AMD EPYC processor and 100 Gbps Ethernet. This CPU model is much cheaper than the 64-core flagship, but has the same amount of cache. (They're made from the same 8-core chiplets, but with 2 cores fused of due to defects.)

In these servers I would use PCI-e quad port NVMe adapters, as you said. The capacity requirements aren't as high as you think either, because the content can be sharded. The 5.6 TB number is for english Wikipedia, not all of Wikipedia + Wikimedia as a whole! So those 4x 8 TB cards are more than sufficient. Heck, even 4x 2 TB is enough for a while. The trick here is to apply some sort of lightweight compression on the text. That 5.6 TB compresses down to just 100 GB! In practice, you could easily get better than 3:1 ratios even with a very fast compressor set to "light" compression.

Then I would distribute these servers around the globe, with about 3 per location. One for english, with the other two for all the other languages. Each server would have a local, read-only replica of the language-specific databases with asynchronous streaming from the master copy.

I'd distribute this to about 5 regional locations, and nominate one server per language as the "write master" where updates occur. So for each language you'd have 1x read/write and 4x read-only. These would be at different locations, so for example German wikipedia would have the read/write replica in Germany. English would be at some US east-coast location. Etc...

Then you'd need some boxes for nonproduction test, dev, etc...

All of the remote edge servers would be load balanced using a DNS-based method, with no local load balancers. The servers' 100 Gbps ports would be directly connected to the peering routers, the same way Cloudflare and the like does it. This would add up to 1.5 TBps of traffic that you really could physically serve (5 x 3 x 100 Gbps).

Overall, the entire platform could be handled by something like 20-25 servers. That's it.

Now, I tell a small lie: Wikipedia hosts only the text! WikiMedia has the pictures, which don't compress well and requie much more disk space. This is best served with technology similar to AWS S3, which can be replicated with open source software and some boxes packed with hard drives. But again, you're probably overestimating the capacity required, and underestimating how much you can pack into a server these days.

Just to reiterate: the above is predicated upon having an efficient codebase, and Wikipedia isn't currently efficient enough to make this possible. It would take a rewrite of the code to achieve this, and that would cost more than their current hardware, so it doesn't make financial sense. Most web sites are in a similar situation, which is perhaps why your perspective is skewed: Your expectations of software performance capability might be off by a few orders of magnitude!

Re:Wikipedia is swimming in money–why is it begging people t... by kaba0 on Monday May 31, 2021 @08:20AM (#27343303)
Come on.. you are being ridiculous. Also, how is your 500ms ping?
Re:Wikipedia is swimming in money–why is it begging people t... by jiggawatts on Monday May 31, 2021 @08:58AM (#27343610)
Which part is ridiculous to you?
Re:Wikipedia is swimming in money–why is it begging people t... by SpelingBeeChamp on Monday May 31, 2021 @07:07AM (#27342743)
Thanks for the insight.
Re:Wikipedia is swimming in money–why is it begging people t... by tored on Monday May 31, 2021 @06:30AM (#27342510)
Why do you think that MediaWiki is not optimized to handle thousands request per second just because it is written in PHP?

MediaWiki repository size is about 1.4 GB and according to phploc it has closer to a million lines of PHP code. Sounds like fools errand to rewrite it.

Re:Wikipedia is swimming in money–why is it begging people t... by jiggawatts on Tuesday June 01, 2021 @08:07AM (#27353293)
I looked into the topic in some detail year ago, because I copied Wikipedia's approach for an in-house CMS editor. I looked through the code, did loads of performance experiments, read through related forums posts, etc...

The wiki staff themselves admitted that the current parser is inefficient, partly because of PHP, partly because the underlying grammar was not designed to be efficient, and partly because the parser itself was built up over time and wasn't easy to optimise.

My approach was to write the parser and a matching "markdown inspired" format at the same time, optimised for speed. Just a handful of small tweaks to the syntax were all that was required to largely eliminate backtracking and achieve a nearly linear parsing time in most cases. If I remember correctly, I had it down to about 1-5ms for a typical 64 KB page, and then HTML generation was another 5-10ms depending on various factors.

What a lot of people are missing here is that Wikis are not at all like typical "ERP" applications. The latter sometimes requires dozens of API calls and thousands of database queries to generate just one kilobyte of output HTML. Wiki is very linear, with a single 1-100KB blob of text as input, a matching 1-100KB blob of HTML as output. It all boils down to the parsing and HTML generation efficiency, nothing else matters!

Re:Wikipedia is swimming in money–why is it begging people t... by tored on Tuesday June 01, 2021 @12:21PM (#27356973)
You don't need to parse the grammar for every request and as they admitted it was an old implementation. What I understand they have a new one now.

You can parse grammar on save and make an optimized compiled format where static content is already resolved. Next step is to substitute semi-static content (like author name) to a runtime format, this last format can handle dynamic data substitution like current date & time, but probably going to be rare that any substitution is needed for the runtime format (how much truly dynamic data does a wiki have?), most of the time just print it with readfile or similar. Only difficult part here is cache invalidation for the runtime format (I know, it is one of the three difficult things you can do in programming).

3000 request/second in PHP is not hard, especially if you plan for it.

Re:Wikipedia is swimming in money–why is it begging people t... by jiggawatts on Tuesday June 01, 2021 @06:12PM (#27362105)
It's not at all hard! A typical Wikipedia page has the "chrome", which changes based on your logon, and then content, which generally does not. Cache invalidation is trivial, because there's only one atomic "blob" to track instead of the output of some complex query.

This is why it amuses me that people seem to think that Wikipedia "requires" tens of millions of dollars of infrastructure to host. It doesn't require it. It's just that some things are better/easier with more kit, such as maintenance.

Re:Wikipedia is swimming in money–why is it begging people t... by yoz-y on Monday May 31, 2021 @05:12AM (#27341968)
> If they used an efficient language instead of PHP, that's well within the capability of a single modern server!

Hm, since Wikipedia dumps are public, has anybody tried? Moving wikipedia itself might be a large endeavor, but seeing some submissions on HN I think a very dedicated dev or two could possibly manage a rewrite to have a proof of concept.

Re:Wikipedia is swimming in money–why is it begging people t... by mschuster91 on Monday May 31, 2021 @05:45AM (#27342233)
Mediawiki markup language is not efficiently parse-able and extremely complex with lots of bolted-on features, which is why it took ages for the visual editor to be implemented as a prototype and to iron out the bugs.

For any attempt at porting over MW, you will need to re-implement the whole parse/include stuff... and that is a lot of work, even for a proper team.

Re:Wikipedia is swimming in money–why is it begging people t... by bawolff on Monday May 31, 2021 @12:08PM (#27345468)
So just steal the parser part
Re:Wikipedia is swimming in money–why is it begging people t... by cycrutchfield on Monday May 31, 2021 @02:44AM (#27340973)
Ok but if they fired all their fundraisers how are they going to get $10m a year?
Re:Wikipedia is swimming in money–why is it begging people t... by mike_d on Monday May 31, 2021 @03:36AM (#27341303)
Stop spending the other $90 million a year.
Re:Wikipedia is swimming in money–why is it begging people t... by yreg on Monday May 31, 2021 @03:20AM (#27341211)
Banner with Jimbo's face like in the old days.
Re:Wikipedia is swimming in money–why is it begging people t... by brigandish on Monday May 31, 2021 @03:20AM (#27341206)
How much comes in via the banner on the site?