---
Most of our sites use the following as a base:
Nginx
PHP
MySQL
Memcached and/or Redis
---
Most of our sites use the following as a base:
Nginx
PHP
MySQL
Memcached and/or Redis
We used to have dedicated 50 Gbps fiber connections straight between the web and memcached nodes, but now the caching is done locally on the web servers with a lot more of them. I would say there's probably something like 100+ servers, 128/256GB RAM each.
All the pages are server-side rendered. Every DB query, every DAO object instantiated, every partial/full page HTML render, even some functions at times, gets put into cache. We weren't really afraid of high traffic, that scaled almost on its own... instead we were afraid of infrastructure maintenance or bad manipulations, because too much of the cache could disappear at once.
The most incredible part to me was the storage and delivery of the video content. Try to picture 7000 petabytes [3] :)
[1] https://www.pornhub.com/humans.txt [2] https://github.com/nitrix [3] https://www.pornhub.com/insights/2019-year-in-review
I should add that this wasn't out of optimisation, just "old-school" PHP+Html with an MVC framework to serve the rendered page.
Still can't beat that in my view.
> The most incredible part to me was the storage and delivery of the video content
That was the fun bit, I still remember the logistic of opening a new origin for the CDN back in 2010 (11 maybe?). Flying hard drives, can't beat that bandwidth.
(Former developer here as well, however from before this humans.txt was introduced)
Local memcached's? local caches or still distributed cache?
If you can host and serve porn on a LAMP stack from a traditional bare metal server data center, the guy on the other end doesn't care as long as it's reliable.
I work at a large tech company now and it amazes me how terribly executed and unnecessarily complex most development efforts are. There was a very strong results-oriented culture at the adult media company.
Like C++, it's not going anywhere, anytime soon; despite all the kvetching about it.
That said, I don't especially like the language, but I knew that I needed to use it, if I wanted to design an infrastructure system that I could throw over the wall to be taken over by a bunch of other people.
I was right.
There's that old urban myth about the fancy space pen, vs. the pencil.[0]
[0] https://www.scientificamerican.com/article/fact-or-fiction-n...
PHP is a kind of crappy OO language, but it is sufficient. I think Java is a better language, for OO. PHP 7+ is lot better than it was, before 5.
A lot of Java programmers came out of school, and started to create PHP chimeras. I feel as if that results in unnecessarily complex code. Things are complex enough, without applying UI-style MVC to server backend systems.
I wrote PHP for around twenty years, starting off procedural and mixed into HTML pages, to OO-based pure PHP systems.
I stopped a couple of years ago. This was my final PHP project[0][1]. It was sort of a "dissertation." No one is actually interested in using it, but it was developed in order to practice my architectural skills. It's a pretty intense system.
[0] https://riftvalleysoftware.com/work/open-source-projects/#ba...
[1] https://github.com/RiftValleySoftware/basalt/tree/master
Their content is relatively cheap to produce and it tends to be churned out at a high frequency. There's almost no industry out there that matches the frequency of content they produce, except maybe radio (and now YouTube). And with new technology, the limiting factor is almost always content creation.
So it makes sense that they'd put aside a few dollars buy some new equipment for some trend. Doing a VR shoot probably involves a new camera and a plugin for Premiere.
I'm confused. How are those two related? Case statements can replace if statements and can be used for exhaustiveness checking. Regexes are for parsing strings.
So managing a bunch of hard-coded code paths via a switch instead of using a regex to pattern-match.
It's less future-proof, but even an entry-level dev can reason about a switch statement and update it as needed.
The benefit is that the regex library costs a lot in hidden complexity - debugging why a particular regex works slowly or eats lots of memory is hard. If a similar problem pops up in hand written code, you can use your standard profilers and other tools to see what's happening.
So you either drag this complexity into your code or dump it on the regex library. It's a trade-off.
I encountered one of these once. A user decided to enter this in the middle of their post:
------------------------------
It triggered catastrophic backtracking, and IIRC, 16 characters was right around where you could see noticeable delay, then at about 19 was when it ran so long it never returned.It totally makes sense to use PHP and MySQL as it's what already works, and because there's a team who knows how to use those correctly in this kind of environment.
I just wonder if they have a research-oriented team that could experiment with whatever they see as a potential fit and see if they can improve performance, developer experience (without sacrificing performance) or both. Or if they don't (and if so - why?)
Facebook is kind of famous for this, as they came up with HipHop VM and Hack.
We didn't have a research-oriented team per say, but myself and a colleague (I was Lead Dev and he Senior) did spend a lot of time experimenting with things like Redis (back when it was very early and "unproven"), varnish, PHP engine tweaks, custom extensions, ... We still did feature work and regular stuff too.
On my resume I don’t list the company name. In its place it says “social network centered around ‘art’” because we weren’t allowed to call it porn.