Stream: general

Topic: A cost-effectiveness perspective of WASM(and I need advice)


view this post on Zulip Namhyeon Go (May 24 2023 at 02:40):

Many people recognize that in order to use WASM runtime on the server side, it is commonly thought that one needs to acquire a complete Linux system (such as a VPS) costing at least around $20 per month, and some may even think it can be as low as $5 with further searching. However, based on my experience over the past year, I have confirmed that runtime portability is achievable even on systems costing as low as $0.2 per month, without requiring the cooperation of hosting providers.

In my opinion, this signifies that tasks that would typically require $20 can potentially be resolved with only $0.2 through WASM. Although this may be a highly limited scenario, it is worth considering.

Of course, on a $0.2 system, there are significant constraints on functions and features related to processes, rendering the Wasmtime runtime inoperable. However, I was able to make it work by modifying WAMR, a C language implementation.

I wonder if my experience could be helpful in advocating the necessity of WASM research to someone in the future. Thank you.

view this post on Zulip Namhyeon Go (May 24 2023 at 05:09):

Additionally, while researching this, I have also encountered the internet data center environments in developing countries. Some countries require a payment of $200, which is 40 times higher than the minimum of $5 that can be obtained in countries like the United States or the one I live in, Korea, in order to obtain the same infrastructure. This is due to the not good state of the infrastructure in those countries.

Even in these countries, extremely limited Linux systems based on the shared environment can be obtained for around $20. I am interested in the potential effects that can arise when porting the WASM runtime to such environments.

view this post on Zulip Namhyeon Go (May 24 2023 at 05:38):

If I have the opportunity to delve deeper into this topic, I believe it would be possible to expand it into broader concepts such as isolated computing (for example, information security). I am also very interested in exploring these larger concepts. However, for now, I am primarily considering approaching it from a cost-saving perspective.

view this post on Zulip Till Schneidereit (May 24 2023 at 07:05):

Hi @Namhyeon Go, thank you for sharing this—very interesting indeed!

Can you say a bit more about the constraints you see on those low-end systems? Are they mostly around memory and CPU usage? I think it'd be very interesting to look into optimizing things more to target low-end environments.

Regarding developing countries, would a possibility be to still use the cheaper systems hosted in other countries? Or does that make latency too high?

view this post on Zulip Namhyeon Go (May 24 2023 at 07:33):

Hi @Till Schneidereit

The most common limitation I encountered on low-end systems was the restriction on accessing cgroups variables. This issue is often found not only in shared hosting but also in low-cost VPS providers in the United States. Fortunately, this aspect seems to be largely unrelated to the WebAssembly runtime.

The limitation I faced during my year-long experience with WebAssembly was the restriction on stack memory access during thread creation. I invested a significant amount of time addressing this issue.

In this case, there were no logs available, and even with the use of debuggers like GDB, it was difficult to pinpoint the problem accurately. It required line-by-line checks to identify the issue.

Initially, I attempted to apply Wasmtime, but debugging was not straightforward. Eventually, I chose WAMR, a C language implementation, due to these reasons.

view this post on Zulip Till Schneidereit (May 24 2023 at 07:35):

ah, interesting! Do you have a link to an offer for one of these VPS systems, by any chance?

view this post on Zulip Namhyeon Go (May 24 2023 at 07:47):

Sure. I used a low-cost web hosting plan in Korea for this work. Although it's not a VPS, it allows shell access to users. The cost is around 250 KRW per month (approximately 0.2 USD). Here is the offer link (please focus on the numbers as the page is in Korean): http://teamjang.com

If you need it, I can obtain the same system and provide you with the information. :)

view this post on Zulip Namhyeon Go (May 24 2023 at 07:56):

This company provides more paranoid low-end systems than the average companies available in Korea. That's why it was good for testing purposes. :)

view this post on Zulip Namhyeon Go (May 24 2023 at 08:23):

@Till Schneidereit

Regarding developing countries, would a possibility be to still use the cheaper systems hosted in other countries?

Such systems are widely used.

When I mentioned developing countries, it was to emphasize that choosing shared hosting can reduce costs even in countries with infrastructure limitations, as obtaining a complete Linux system in those countries can be expensive. It does not mean that such systems do not exist in the United States or Europe.

An advanced countries have a much larger number of low-end systems, to the point where they cannot be compared. For example, applications like Wordpress mostly run on shared Linux systems. These are the types of systems I'm referring to. While these systems come with significant cost advantages, they also have many limitations.

However, if you can run your runtime on such systems, you can operate it much more affordably compared to obtaining a full-fledged Linux system like a VPS.

view this post on Zulip Namhyeon Go (May 24 2023 at 08:55):

In summary... If we search well, we can find a completed Linux plans (such as VPS) in the US for as low as $1 per month. However, I desire a more challenging environment. I believe there is no reason why we can't run a WebAssembly runtime for $0.1 per month.

(I'm worried that talking like this might make me seem like a villain, but please don't misunderstand.)

view this post on Zulip Mikkel Mørk Hegnhøj (May 24 2023 at 09:27):

It makes perfect sense to me :-)

view this post on Zulip Namhyeon Go (May 25 2023 at 06:18):

At first, I was very interested in porting the WASM runtime to well-known applications and software, such as Wordpress, Office, Photoshop, AutoCAD, and so on. Utilizing WebAssembly in those applications seemed like a fascinating idea. However, I became aware of the reality of my social position, and I soon realized that pondering such topics would not be right. It would simply be a waste of time for me.

Nevertheless, thanks to that realization, I gained valuable insights into leveraging the WASM runtime on low-end systems. If I continue my research, I intend to explore the development of a deployment framework for running the WASM runtime on a $0.2 system.


Last updated: Oct 23 2024 at 20:03 UTC