Common question

common question
how do you build a server that can hold up to million users?

Attached: 1200px-Node.js_logo.svg.png (1200x734, 52K)

Other urls found in this thread:

techempower.com/benchmarks/#section=data-r15&hw=ph&test=db
github.com/mach-kernel/vertx-polyglot-counter#benchmarks
github.com/lpereira/lwan
github.com/dcodeIO/protobuf.js/issues/1056
twitter.com/SFWRedditVideos

1. Switch to a better language

You use network switches so after a set amount of users being served by one IP has open sockets, you switch to a new server on a new IP
Language has little to do with it at high numbers, nginx can only hold about 600requests/second nodejs gets about 400

man thats sounds right can you explain more about open sockets
and switching servers?

ignore this backwards ass nigger and use a loadbalancer like a normal human would.

Swich to Gulag (Golang)

Attached: gulag.png (474x473, 16K)

use literally anything else other than node.js

This. Multiple servers behind a reverse proxy running a loadbalancer.
What kind of shit is trying to say?

You buy more servers

Attached: Kubernetes_(container_engine).png (209x204, 13K)

well fagots no answer yet?

your app is stateless, it can be instantiated a 1000 times using docker and load balancer can be used to give requests to them

reengineer your program to be entirely p2p.

I can store 1mil users on a local sqlite3 store. db rows are small, user databases are small.

If what you're asking is how would you handle requests for a million uses?

1.) a CDN
2.) Stateless Application Tier
3.) Caching
4.) Replicated Data tier.

what kind of libraries/CDN?

nginx balance

it is a lot easier if you have smaller users

lmaoing

still nothing g?
so autistic

F5 + multiple servers to serve users

>nothing
>thread already has answers

kys

yeh fagot nothing specific just mumbling

>F5
didn't knew about this

do you use it?

I work at a place that uses it for load balancing, fail over, etc. Pretty useful service as long as the people managing it aren't complete and utterly braindead and do things that break everything randomly.

>how do you build a server that can hold up to million users?
You dont. What you do is to build several servers
maybe 4 or 5 servers that are interfaced with load balancing switches and various synchronisation techniques that involve synchronising with a unified database behind the web server or whatever type of server you are creating

Do you want a list of commands to run on your server or what?
The answers are right. Go implement them.

i dont want a couple of servers i want one the winner get the golden egg:)

1. Use vert.x and not shitty node.js. Vert.x can handler more requests per second, supports multithreading and isn't written in a shit language.
techempower.com/benchmarks/#section=data-r15&hw=ph&test=db
github.com/mach-kernel/vertx-polyglot-counter#benchmarks

2. Use a load balancer + multiple stateless servers, optionally clustered

Also, if you use vert.x with 10+ verticles on a server with 10+ cores you don't even need multiple servers to handle the load. At my job we are easily doing 1m req/s on a single instance

>the vert.x guy again

nice

Also use caching in an in memory db

He's trying the dumbass load balancer approach, basically 100% utilization of a server before balancing to a second server.

github.com/lpereira/lwan

Use Go

Serve your frontend from an S3 bucket and use AWS Lambda functions as the backend.
Or a load balancer like other anons have said.

>giving the one benchmark where it scores well
vert.x gets shit on in all the more realistic ones
and Java is cancer

>a benchmark where you ask the server to reteive data from a database is unrealistic

Only cancer here is you. Go and show me these realistic benchmarks you speak of.

Go to that Techempower benchmark you linked but click on any other tab than "Single query".

Are you implying that "being shit" on equals to still being top 3 - top 30 in worst case? Wow I guess all frameworks and languages are shit then because no one is #1 at everything.

Are you even aware what the other benchmarks do, specifically the one where vert.x performs the worst (json serilialization)?

Are you aware that the other "frameworks" that got high ranking results are in most cases jst very limited low level libraries that you can't really use for the same kind of application development as vert.x, without writing a lot of boiler plate?

hire a competent dev

>Java
>Little boilerplate
The code is on their github. The code for the vert.x app isn't cleaner than for most of the other frameworks, with the exeption of the C/C++ ones. But vert.x gets outperformed by Dart apps that are simpler.

You still aren't getting it.
vert.x is not just a simple webshit server that lets you shit out lots of reqs/s (although it does that very well too), but an entire toolkit for more than that. Examples include clustering, offloading long running tasks, service discovery, etc. Stuff that goes beyond "my framework can do http very fast"
It makes development easier, if I were to choose tokio-minihttp for example I'd have to build a lot of shit myself just to be able to do more than basic CRUD.

Actix is the only thing that I found to be similar to vert.x in that regard but its not quite ready yet.

Also the dart example you speak of is the only one where dart managed to rank high and it beat out c/c++ implementations too, which is odd.

The Dart apps outperforming C/C++ I suspect is because of the PostgreSQL driver.

I get it, vert.x is capable, but it's Java and therefore shit and will require a lot of ugly and verbose code.

Have you ever noticed how every real-world Java app feels sluggish and uses tons of memory? Sure, you can blame the programmer, but apparently writing good performing Java apps is too difficult for almost every Java programmer.

Because many Java programmers are bad or stuck in an outdated tech stack (JEE, Spring, although spring finally joined the reactive meme). Also there's a lot of legacy applications that didn't have Java 8 features. Comparng a new Dart app to some old IBM monstrosity isn't a fair comparison. Modern Java is actually pretty concise with things like RxJava.

If you are using stuff like vert.x your memory footprint will actually be quite low and there's the option to use GraalVM if you really need a low memory foortprint. Java takes the RAM it needs in order to let the hotspot part of the VM optimize the JIT compiling, which makes long running applications faster. RAM is a non-issue serverside and if you wanted desktop development then JavaFX still beats crap like electron.

I like not being able to work when the cloud is down

github.com/dcodeIO/protobuf.js/issues/1056

>but it's Java and therefore shit and will require a lot of ugly and verbose code.
But you can use Scala and Kotlin, no?

Yes, that too

You can have state if it can be interacted with asynchronously. Not all data has to be perfectly up to date in a SQL db. The uploads system I work on at my job can handle tens of millions of requests a day and the state is stored in S3 which has proven to be extremely fast for us.

Then get one xbox hueg server and run VMs on them.
If NodeJS can only handle a small number of requests then the only answer is to run mutliple instances of NodeJS. Whether you do that on docker containers or on KVM VMs is up to you, either way you're gonna need a loadbalancer in front of it either running bare metal or in it's own VM.

Attached: 1514305635511.jpg (218x231, 13K)

Sign up for was, click around yourself an ecs and alb, dockerize a little anything server, throw it on.
Takes less than an hour and handles tens of millions, done

>how do you build a server that can hold up to million users?
0 servers

blockchain using html localstorage

randomly selecting someone on every 1000 users as a node per region depending on how long they stay on the site

1. Bigger server
2. Load balancer
3. Switch to erlang/elixir
4. Don't self host - get a cloud environment that can auto scale

Any of the above
These are correct answers as well

You can use Scala and Kotlin with vertx u moron

your app is still stateless if the only state it relies on is on s3 my friend. nobody said anything about sql