How to share CPU or RAM?

21

7

In networking we share File(Disk Driver) or Databases. But how can we share CPU or RAM over the network.

MJH

Posted 2011-03-12T00:45:33.487

Reputation: 505

I guess the closest thing to sharing RAM over a network is a caching grid like Oracle Coherence, or Memcache. But like the other answers have said, this requires the application binary to be written with that specific library. Maybe one day we'll have have a standard like NFS for volatile memory. – Sridhar Sarnobat – 2014-08-29T01:07:55.027

3The problem with doing this is that compared to the nanosecond-scale latencies between CPU and RAM, a network is incredibly slow! – Phoshi – 2011-03-12T01:06:52.550

@Phoshi: Even with the latencies added by network, such setup might be faster than disk-based swap. – Piskvor left the building – 2014-02-24T14:30:02.873

@Piskvor: But as anyone can tell you, disk-based swap is a pretty massive performance hit! – Phoshi – 2014-02-24T15:02:22.683

@Phoshi: I agree - indeed it is, and the optimal solution is "add more physical memory." All I'm saying is that paging out to a fast device (e.g. a ramdisk) over a fast network might still be faster than paging out to a physical disk. In other words: this might be a faster swap device than a swap on a physical medium, even though it will be many orders of magnitude slower than physical RAM. – Piskvor left the building – 2014-02-24T15:07:19.997

1@Piskvor: Entirely plausible, and even if you're wrong it's certainly on the same order of magnitude, so wouldn't be significantly worse in the worst case. I suppose it's probably just cheaper to have more local physical storage! – Phoshi – 2014-02-24T15:09:48.080

@Phoshi: Significantly more complex to set up, though (as opposed to e.g. RAID0-backed swap). – Piskvor left the building – 2014-02-24T15:11:51.190

Answers

21

To do this the program(s) accessing the CPU/RAM resources must be specifically designed to access said resources. A system set up in this manner is called a cluster, and the typical way resources are shared is with a protocol called MPI (message passing interface). It is a free download and using it with Linux can yield a powerful cluster (possibly even a super computer) for minimal cost, but again it is useless unless you have programs that were specifically designed to take advantage of MPI. There are some good cluster tutorials out there, if you are still interested you should check one out.

Edit:

I would recommend the tutorial here if you want to set up a cluster. I made a cluster by following this tutorial about a year ago and it worked pretty well. The tutorial is a bit old, so some files may not be exactly where the tutorial says they are (sometimes files get moved around in different/newer Linux distros) but if you are the least bit familiar with Linux it should not be an issue. The tutorial uses an older version of MPI, but I used the newest version and had no issues that were not easily resolved. Depending on what you are doing there may actually be a program out there that can take advantage of MPI. I know there are some video encoding and number crunching programs that take advantage of MPI that can be downloaded from universal sources.

ubiquibacon

Posted 2011-03-12T00:45:33.487

Reputation: 7 287

please tell me some references. – MJH – 2011-03-12T01:31:02.137

1@MJH see my edited answer. – ubiquibacon – 2011-03-12T05:59:37.963

thanks.but this tutorial work on Linux and I use Windows.also by this,application must write under MPI,and its constraint. – MJH – 2011-03-13T21:48:52.387

3

@MJH if you want to work with Windows then you just need an MPI library that works with Windows, but the concept is the same. MPICH works with Windows, or you could build your Windows cluster with Windows HPC (has built in MPI conductivity) if you have some coin to drop. While this does let you use Windows, your will still have to use programs written for MPI, there is no way around that at this time.

– ubiquibacon – 2011-03-14T03:12:55.283

2

Thanks for this answer - the referred tutorial seems to have changed address to http://www.uiowa.edu/mihpclab/hpcSystsemTechnicalReport/HowToBuildAClusterG.pdf ... Cheers!

– sdaau – 2013-08-28T07:33:17.953

@sdaau I just updated the link, try it now. – ubiquibacon – 2013-08-28T13:21:17.820

9

You can share RAM using RAM disks, but that looks just like sharing normal disks, except that these are in another computer's RAM. There is no direct way for one computer to use another computer's RAM as if it was its own RAM, but there are some ways to use other computer's RAM. More on that in next paragraph.

As for CPU sharing, it's possible but there is no single standard for it. You can't just share it and let another computer take needed resources. Instead you need to have specifically designed applications which can work on several computers at one. This is often called distributed computing and is used by some research projects such as SETI@Home, Einstein@Home, Climateprediction.net and many others.

Basically programs work in such way that there is one central server which distributes the work which needs to be done. Computers on network download work units from central computer and process them. After that central computer receives results from clients and merges them into one cohesive result. This way computers "share" CPU and RAM resources over network. The downside of this is that programs need to be made in such way as to work over network and right now distributed computing isn't popular enough among common uses for a computer so only a small number of specialized programs support it. On the other hand, it is commonly used for scientific purposes as it is cheaper to obtain large number of personal computers or playstations 3 than it is to obtain access to a mainframe computer.

AndrejaKo

Posted 2011-03-12T00:45:33.487

Reputation: 16 459

is there software for share my application in my network?without need to foreign network!(for ex. i want rendering a file,that my PC render this in 7days,but i share this to my network and rendering reduction to 1 day? – MJH – 2011-03-12T01:19:21.507

@MJH Unfortunately, I haven't heard of any programs which could to that for rendering. – AndrejaKo – 2011-03-12T08:03:12.250

1sharing ramdisks is kinda pointless though isn't it? You get the volatility of ram, with the slowness of network attached storage – Journeyman Geek – 2013-03-30T06:11:23.930

1

@AndrejaKo For straight up video transcoding I have not heard of any either (but some doing googling I did find 1 or two project in alpha/beta that do). However, for 3D rendering, I have not seen a 3D rendering program since the 90's that does not support network rendering.

– Scott Chamberlain – 2013-09-12T13:50:45.337

5

is there software for share my application in my network?without need to foreign network!(for ex. i want rendering a file,that my PC render this in 7days,but i share this to my network and rendering reduction to 1 day? – MJH Mar 12 '11 at 1:19

You have fallen in to a XY Problem, you should not of asked "how can I share cpu and ram accros computers" but "how can I use multiple computers to make my renders in using ZZZZZ faster?"

It is highly dependant on what software you are using, and what you are rendering (are you transcoding video, or are you rendering a 3D model/video?).

To pick a few examples the free 3D software Blender supports distributed rendering where you can have many computers all working together to generate one output. If you are doing video rendering some quick googling found the open source project MediaEncodingCluster that allows you to render video and audio files using multiple computers.

Scott Chamberlain

Posted 2011-03-12T00:45:33.487

Reputation: 28 923

5

The only operating system I know which allows to share CPU/RAM is plan9. There you can export/mount almost anything. This doesn't means performances are good, of course.

Heinrich Spindeln

Posted 2011-03-12T00:45:33.487

Reputation: 51

0

It would be a nice feature to share cpu/ram for tasks over network. Currently we are still bound a bit of old notions to keeping programs in the box where things happen, but we can allow multiple cpus on same machine to access same sniplet of code. We do have one method (at least) that does something like this. java on webpages work by using both server and client, but it's still locked in a server-client way to do things (where server holds most of the data). What we need to be able to assign tasks to machines in much the same way as we do when we have multiple cpus (except machine that does the work need to have program snip and data snip assigned. This does put a heavier load on network though if the tasks themselves isn't of a simple nature and could result in new bottlenecks forming. I like the idea where it's repetitive tasks though in methods much like key mining.

k9dog

Posted 2011-03-12T00:45:33.487

Reputation: 51