How many CDN's do you need for avatars?
-
Before I report this thread for jeffing, is everyone okay with the Discourse discourssion being moved somewhere a bit more public?
[poll type="number" min="0" max="1"][/poll]
-
remarkably sane and useful ... I wonder ... conscious rationale ... or just a side effect
This is Discourse. You know which one it was.
-
-
-
Ruby has a global interpreter lock, so only one thread per process can run Ruby at a time.
Gaaaaah! RANT TIME!
I despise systems that do this. The problem is that they've decided to treat the space of values as a single global global resource across all threads. Programmers used to C usually tend to think like this. They then look at what this requires to make work, and discover that ensuring they don't get memory corruption is really hard (no fucking shit, sherlock!) and slap in a global lock to protect access to the big-ass global state that is any value in (non-stack) memory. Which actually means everything so boom, there goes threading (unless you're very IO-bound) and you're getting no benefits from threads and yet plenty of complexity.
The ways to fix this are to either:
- Put lots of fine-grained locks in, at a huge cost. It's possible to cut the cost quite a bit when you know that a value is only held by a single thread, but anything complex that crosses threads has to bear the full cost and all the pain of ensuring that all accesses to it are correct. But that really leads on to…
- Strongly partition the threads so stuff never crosses between threads (except by guaranteed serialisable messages) and that lets you get rid of having global locks (except in a few places where dealing with the OS). There's a few ways to send messages around efficiently, but since the messaging system is a very defined interface, it's quite simple to make the fucker work well.
Messaging-based parallel systems look way more expensive than shared memory at first glance, but it turns out they scale up better because they don't need to fuck around with global resource contention nearly so much. The down-side is that converting from one to the other is non-trivial; their natural way of approaching parallel problems is totally different.
Global Interpreter Locks? An indication of an incompetent language designer who cannot into parallel.
END RANT
That this is all mixed into Discourse is unsurprising. That there's a system which exists to make this a fat disaster (Ruby and Unicorn) is unsurprising. The team's talent for picking a superficially-OK-but-really-bad choice is once again proved to be unerring…
-
Messaging-based parallel systems look way more expensive than shared memory at first glance,
Why not a combination, like Go's channels? Your threads run in the same memory space, but you can send values to other threads. Your program defines the semantics, so you can either discard the value after sending it or hold onto it and use it from multiple places. Values are always copied, so you don't have to worry about someone else touching a struct you sent them, but copying a pointer doesn't do much.
-
-
That all sums to, "use C#". Which Atwood has used for large websites in the past. But which is decided not to use for Discourse because...?
I wonder if there's like one exact point in time at which he became shitty. Like after he determined the StackOverflow architecture, but before he started working on the gamification features...
-
So after Yami changed her avatar, the images in the post-that-is-now-OP updated too.
Post-Jeffing they appear to me as showing the old Yami-with-Mafia-hat avatar again.
-
...and that, folks, is why they have made the CDN url public.
-
Well, it's one way around the word filter…
Edit: Hmm…
Works with numbers
This is the only punctuation I've found to work
…and Kanji doesn't work
-
Oh, dear.
-
Discovered a funny way to DoS the CDN by writing lengthy posts like a serial killer?
-
Probably. And it is only a matter of time before Ben tries to fa_spin the whole thing.
-
-
No -1?
LAME!
-
@RaceProUK said:
Not using Discourse.
What about digest e-mails or e-mail notifications?
But in order to get those, you have to at some point use Discourse, so…
-
What about digest e-mails or e-mail notifications?
Have you tried using email notifications? They aren't exactly...fast. And replying via email is slow as well. I'm assuming there is a job that runs every 5 mins to check your notifications and email them to you (you won't get an email if you have viewed the notification in ) and post anything you sent in via email.
Pretty sure there is a better way to make it work, because it really isn't a brilliant user experience.
-
I tried to create a post which contained every letter in 147 different colours. The Chrome tab with that in it has been maxing out 1 core and had still only got rendered as far as J in the preview pane after 5 minutes.
A HTML document with the same 3822 IMG tags in it loads in ~15seconds after a hard refresh.
-
Well, it means that if you stop interacting with Discourse, it might not actually help.
-
IIRC Discourse doesn't send emails for post-related notifications until the ninja edit window expires. I'm sure I read a post about it on fail.d recently.
-
Oh, dear.
function cdnify(x) { var len = x.length; var str = ""; for (var i = 0; i < len; i++) { var letter = x[i]; if (letter === ' ') { str = str + "\n" } else { var baseurl = "https://avatars.discourse.org/letter/" + letter.toUpperCase() + "/"; for (var j = 0; j < 3; j++) { var rnd = Math.floor(Math.random() * 255); var rndstr = rnd.toString(16); while(rndstr.length < 2) rndstr = '0' + rndstr; baseurl = baseurl + rndstr; } baseurl = baseurl + "/50.png"; str = str + "<img src='" + baseurl + "'></img>"; } } return str; }
cdnify('Welcome to Discourse')
-
-
What in the actual fuck is that.
-
I think it's a B but I could be wrong?
-
I believe it is indeed a B.
OK, so the CDN has absolutely no concept of contrasting colours at all:
https://avatars.discourse.org/letter/A/ffffff/50.png
-
I suspect every single colour from 000000 to FFFFFF is available. I only tried the hex values listed here.
-
Why would it be able to contrast? Everyone knows White is the best disco avatar text colour and anything else is
-
That all sums to, "use C#". Which Atwood has used for large websites in the past. But which is decided not to use for Discourse because...?
If memory serves me correctly, Jeff wanted to build something which could run everywhere, not just on Windows.
So they painted themselves into the Dockercorner instead which basically rules out Windows, as 'Docker on Windows' means 'Windows running a Linux VM with Docker in it'.
-
If he wanted something that could run on any platform he could have used Java
-
which basically rules out Windows
And which they only support when it's either Discohosted or run on Ubuntu via Digital Ocean.
-
Java could have been a sane choice.
-
-
These days, I think they could've used C#...
-
I don't think that works.
Maybe manually rule out light colours and use a white-on-white for space?
-
-
This is the only punctuation I've found to work
Amusingly as it doesn't work anywhere else on Discourse
-
isn't it the only nonletter legal-ish in shortnames?
-
Yes but not at the end of shortnames.
-
Sorry @LB_
-
PowerShell:
cd $env:TEMP rm "trolleybus.txt" -EA SilentlyContinue $input = read-host "Please enter the string you wish to convert" if($input -notmatch "^[a-zA-Z\s_0-9]+$") { throw "Invalid input." } $chars = $input[0..($input.Length)] foreach ($char in $chars){ $color = '{0:x}' -f (Get-Random -Minimum 1118481 -Maximum 16777215) if($char -eq ' '){ $char = "_" $color = "ffffff" } $temp = '<img src="https://avatars.discourse.org/letter/' + "$char" + '/' + "$color" + '/50.png">' ac trolleybus.txt $temp -NoNewline } start notepad.exe trolleybus.txt
Enjoy.
-
Underscores and numbers work too
-
Numbers do? That's .
Hold on, then.Fixed.
-
This post is deleted!
-
Feature Request: Serial Killer mode, where some of the letters are randomly resized or kept as plain text
-
Christ...that's enough scripting for one weekend.
-
-
You are murdering much more than just the CDN.
-
If memory serves me correctly, Jeff wanted to build something which could run everywhere, not just on Windows.
Right; because Mono didn't exist back when they started Discourse. OH WAIT IT DID.
And according to his "10-year-plan" he should anticipated the native C# compiler port to Lunix. Because it happened way before 10 years was up.
-
These days, I think they could've used C#...
THEY COULD HAVE BEFORE!!!
Why the FUCK do so many IT people not know about Mono? Just retarded? Is that it? Fucking retarded dumb as shit? I guess that's it.