RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

RunUO, Linux, and Mono

Rabban

Sorceror
Now that there's very little effort required to set it up, is there a Capacity/Stability/Security comparison of RunUO on a version of given version of Windows vs Linux and Mono using the same hardware?

On second thought, capacity will most likely be limited by the server's internet connection though I guess we could compare startup/save/restart times...
 

Mark

Knight
Rabban;792717 said:
Now that there's very little effort required to set it up, is there a Capacity/Stability/Security comparison of RunUO on a version of given version of Windows vs Linux and Mono using the same hardware?

On second thought, capacity will most likely be limited by the server's internet connection though I guess we could compare startup/save/restart times...

For someone new to Linux in general there are a few potential 'gotchas' to keep in mind. Here are a few things off of the top of my head:
  • Linux is case-sensitive.
  • Regular users cannot bind to ports below 1024.
  • Linux has file descriptor limits (the default is usually 1024 and it would need to be raised for a large server).

There are still some things that need to be tweaked for Mono:
  • Documentation Generation
  • Auto-Restarting

There might be other issues that nobody has come across yet. I would also like to make the Mono version background the process and log to a text file instead of direct output to make it more 'console-friendly'.

I would imagine overall security would be better with Linux/Mono simply due to the way Linux is designed and implemented (SSH, regular user accounts, open source review).

Linux servers are usually cheaper to rent.

Memory usage seems to be the same. I haven't benchmarked thoroughly though.

I've successfully used Gentoo, Debian, Ubuntu, and Fedora to run RunUO. Any distribution should suffice though.
 

Acronis

Sorceror
The FD limit can vary from distro to distro but yeah it's usually 1024. This can be modified by the running app though. I'm not sure how to do it in C# but in C++ It's like this:

Code:
	void SocketServer::SetFDlimit(int limit=65535)
	{
		#ifdef linux
		struct rlimit fslimit;
		fslimit.rlim_cur = limit;
		fslimit.rlim_max = limit;	
		setrlimit(RLIMIT_NOFILE, &fslimit);	
		#endif
	}

I'm sure C# must have an equivalent to that. There may be other unwanted side effects to raising it though, but I've been fine. I was able to sustain over 10k concurrent connections of random data on a test tcp server API I coded.
 

Mark

Knight
Acronis;792742 said:
The FD limit can vary from distro to distro but yeah it's usually 1024. This can be modified by the running app though. I'm not sure how to do it in C# but in C++ It's like this:

Code:
	void SocketServer::SetFDlimit(int limit=65535)
	{
		#ifdef linux
		struct rlimit fslimit;
		fslimit.rlim_cur = limit;
		fslimit.rlim_max = limit;	
		setrlimit(RLIMIT_NOFILE, &fslimit);	
		#endif
	}

I'm sure C# must have an equivalent to that. There may be other unwanted side effects to raising it though, but I've been fine. I was able to sustain over 10k concurrent connections of random data on a test tcp server API I coded.

It looks like Mono has the beginnings of an API but setrlimit isn't implemented yet. See: Mono Documentation

We don't need that API though. We could (and likely would prefer to) just call setrlimit ourselves (we already import libc for read).

Regardless, setrlimit isn't the problem. From what I've seen, both the soft and hard limits are 1024 by default in most modern distributions. Regular users cannot (even with setrlimit) increase their FD limit above the hard limit. Root could of course use setrlimit to set their own FD limit up to fs.file-max. The method of raising the FD limit (hard and the default soft) for a regular user (by root) varies by distribution, but usually involves root modifying limits.conf and possibly some files in pam.d/.

This is all sort of academic though. If someone has a RunUO server with around a thousand clients it's probably their box (they have root access or access to someone with root access) and not a shell on a friends server. They can easily modify limits.conf for the user RunUO runs under. If they choose to run RunUO as root, they can just use ulimit -n before starting the server.

EDIT:
For anyone curious, you can check the current number of file descriptors used by doing the following (change <PID> to the PID of your Mono/RunUO process):
Code:
# lsof -p <PID> | wc -l

I would estimate that a bare RunUO server would use 50-75 (listening socket, log files, Mono libraries, data files, etc).
 
Top