Rustixir

Rustixir

How serving static files to 10K client

My static files is png/jpeg and many
video ( under 20mb )

Each client download one times

I not interested in amazon service (s3)

I read ngnix benchmark from itself website .

It can handle this load in single machine
with 8core and 16Ram.

Is it good solution or exist another ?

Marked As Solved

kartheek

kartheek

When you have to scale horizontally(add more servers) - you will have to use load balancer. Load balancer can distribute traffic based on different algorithms like round robin, connections, resource usage, etc.

Before you scale horizontally - its better to try out scaling vertically (increase the hardware of the current server).

Nginx will surprise with its performance on how much it can deliver given enough hardware. Only problem with nginx is understanding the configuration part of nginx(sometimes it becomes tricky). There are some tools out there which can help - NGINXConfig | DigitalOcean .

As with any production configuration - you have to be sure of what your are doing. “When in doubt - research more”. Try out your changes on a dev server or staging server.

Also Liked

l00ker

l00ker

Another option is MinIO. MinIO supports Amazon’s S3 API and works with waffle & ex_aws_s3.

I’ve successfully used it as a simple self hosted CDN with the idea that if traffic and/or storage space ever exceeded comfortable levels, I could move to a cloud storage provider that supports the S3 API with basically what amounts to a configuration change.

derek-zhou

derek-zhou

BackBlaze + Cloudflare seems to be quite popular these days and should be very cost effective.

derek-zhou

derek-zhou

Cloudflare is a CDN. BackBlaze is a cloud storage.

kartheek

kartheek

I have used nginx and it is better for serving static assets. Nginx served static assets to a lot more clients concurrently than you are looking for in production. You have to enable cache control and expiry headers in nginx. Also do some linux configurations about open files, max connections, etc and you can start serving static assets very efficiently.

Start with lowest possible hardware suitable for production and do a load testing for your assets. If it doesn’t perform well check whether it is a configuration issue or system resources like cpu, network are maxed out. If the system resources are maxed out - upgrade hardware to next level.

Once in production you can keep monitoring the server behaviour and tweak hardware.

I would go with nginx anyday for serving static assets if I am not using CDNs.

Where Next?

Popular in Questions Top

Patoshizzle
After calling mix ecto.create I get this error: 17:00:32.162 [error] GenServer #PID<0.412.0> terminating ** (Postgrex.Error) FATAL...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod -- where is this set? Thanks.
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New

Other popular topics Top

freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
quazar
How to set Jason to encode all fields in ecto schema, I don’t care about security and implementing only is taking long list of attributes...
New
ovidiubadita
Hey all, I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
Qqwy
Original source of discussion: This topic on the Pragmatic Programmers' Functional Web Development with Elixir, OTP, and Phoenix forum. ...
New
AstonJ
by Lance Halvorsen Elixir and Phoenix are generating tremendous excitement as an unbeatable platform for building modern web application...
460 27162 124
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New

We're in Beta

About us Mission Statement