Multi-process webserver vs multi threaded web server? [closed] - multithreading

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
I would like to know why we prefer to make web servers multi-threaded
instead of make it multi-process web servers ....
Is it because of legacy issues.....
I would like to hear practical reasons as well as theoretical reasons

On *nix, to start up a process you need duplicate all the resources of the parent process. All the parents file descriptors are dup'ed, for example, and a new memory space is created to contain the new process. When the process terminates everything has to be torn down.
A thread, on the other hand, is essentially just a stack. Very quick to start and stop.
Early web servers didn't use threads for a simple reason: they weren't implemented yet.

Threads are usually cheaper than processes.

Related

I keep getting errors when I try to make a multiplayer game in python [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have been running into problems recently where the client-side of a networking game never read/recognizes the server. When I tried to use the socket module the client never accepts the socket. I used a module called NetworkZero, but that never returned more than None when I used .discover(). I have no idea what the problem is. Any ideas are appreciated
There are many ways to set up an interface between clients and servers.
The easiest is probably to start with HTTP especially in Python where you can just use requests and poll for your data.
This will get you to prototyping quickly and then you can put your focus into optimizing when you start running into issues.
Of course this may be a less than optimal solution depending upon the nature of your game. Without context I would recommend using simple client/server communication systems you understand.

Modern Web Application - Design [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I am building a large web application in node.js and I'm always faced with the question 'where should the heavy lifting be done?' I was always taught that the 'logic' should always be done in the backend of the application, but with modern computers and browsers being so powerful it begs the question if some of the heavy lifting logic can go in the front end.
So context to my specific application. Using angularjs and postgres. A specific question is: would it be a bad practice to have the back end api fetch the rows from the database and pass it to the front end. And then have the front end deal with the logic of deriving the information from the rows? Things like counts with in date ranges and such. (ignore security for this question) or should all the be done on the backend?
If it deals with script that doesn't need to be hidden or is not a secret, then I would suggest putting most of it on the front-end, it would lessen the stress on your server and give you more space to run more processes at a time without filling the ram.

Why don't developers run games on clusters? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
With multicores now more common, game developers are now leaning toward the use of threads, which is discussed in this question:
Why don't large programs (such as games) use loads of different threads?
To me, this idea seems analogous to the idea having multiple machines running things in clusters, or parallel computing.
Some games run on dedicated servers.
My question is: Can you use clusters to maximize parallel power, in the same way threading does on a multi-core system? Will it give the same benefit? Why/why not?
You can do that. But sharing the computation of a Game engine between clusters will introduce more bottleneck to the system. Because clusters will us the network and it is way slower than CPU and main memory.
Some games use simulation clients to share large computing loads. But they need to be pretty careful about the synchronization issues caused by the network delays.

What resources do threads share and not share? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
For some reason I cannot find the answers to this. Multiple threads can be associated with the same process. It's called a multithreaded process. One of the good things about multithreaded processes is that they share resources. But what resources do they share, and what resources do they not share?
I know there are both shared resources among threads of the same process, and there are resources that may not be shared among threads of the same process.
They share a common view of memory. A pointer created in one thread is useable in another. Similarly, a value set in one thread will, with caveats, be visible in another thread.
They do not share a stack. Their stacks are located at different addresses in memory.

dedicated servers for socket.io? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
One of the main features in my website is a simple One-to-One chat.
I'm debating whether or not I shall dedicate a server (or a cluster) for the sole purpose of this chat feature. The simpler option would be combining this feature as part of the web-servers and just scale out when necessary.
It is worth mentioning I'd like in the future to enable images transfer within the chat.
So what is the better option and why?
Well yes, Whether to use another dedicated server is not depending on how much traffic your site will have to handle. If you're dealing with images It will be a good idea to store them in another server and keep the root server clean.

Resources