{"id":18325508,"url":"https://github.com/victorkoenders/pixelflut","last_synced_at":"2025-04-06T00:31:17.658Z","repository":{"id":37905331,"uuid":"144032614","full_name":"VictorKoenders/pixelflut","owner":"VictorKoenders","description":"Pixelflut server written in rust, aimed at being able to run performance experiments","archived":false,"fork":false,"pushed_at":"2023-06-07T15:57:28.000Z","size":343,"stargazers_count":6,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T14:08:51.194Z","etag":null,"topics":["pixelflut","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VictorKoenders.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-08T15:22:08.000Z","updated_at":"2024-02-13T10:17:05.000Z","dependencies_parsed_at":"2024-11-05T18:49:28.486Z","dependency_job_id":"004e92b8-2ef6-4936-8378-6e067424aa36","html_url":"https://github.com/VictorKoenders/pixelflut","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKoenders%2Fpixelflut","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKoenders%2Fpixelflut/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKoenders%2Fpixelflut/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKoenders%2Fpixelflut/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VictorKoenders","download_url":"https://codeload.github.com/VictorKoenders/pixelflut/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247419597,"owners_count":20936009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pixelflut","rust"],"created_at":"2024-11-05T18:42:41.714Z","updated_at":"2025-04-06T00:31:14.280Z","avatar_url":"https://github.com/VictorKoenders.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"![](https://raw.githubusercontent.com/VictorKoenders/pixelflut/master/assets/db9c0554-b464-11e9-9eea-abedc0ce7926.gif)\n\nAnimation created by [@k_henhey](https://twitter.com/k_henhey)\n\n# Running the server\nTo run the server, you need to install rustup:\n\nhttps://rustup.rs/\n\nMake sure `cargo` exists in your PATH. Then you can run the server with the following command:\n\n`cargo run --release --feature \u003cmode\u003e`\n\nOn linux, this server will display it's screen on a [framebuffer](https://docs.rs/framebuffer). When running this server on a different operating system, a warning will be printed and no output is shown. The server should still accept connections on the other platforms.\n\n# Modes\n\nThe server currently supports 5 modes.\n\n## threadpool\nIn this mode, the server starts up a thread for each logical core on your machine (as determined by [num_cpus::get](https://docs.rs/num_cpus/latest/num_cpus/fn.get.html)). The number of cores can be optionally configured with a `-c N` flag.\n\nEach incoming connection gets distributed over the different threads. Each thread will loop through the existing connections, see if there is data available, and parse that data.\n\n## max-threads\nIn this mode, a new thread is spawned for each incoming connection. This results in hundreds or thousands of threads, which are all blocked on the stream for incoming traffic. \n\n## tokio\nIn this mode, the server starts up a [tokio](https://tokio.rs/) pool and handles the clients on that. The number of cores can be optionally configured with a `-c N` flag.\n\n## async-std\nIn this mode, the server starts up an [async-std](https://async.rs/) pool and handles the clients on that. The number of cores can be optionally configured with a `-c N` flag.\n\n## io-uring\nIn this mode, the server uses Linux's [io_uring](https://en.wikipedia.org/wiki/Io_uring) to handle clients.\n\nThis mode can also be combined with `tokio`\n\nThis mode requires the `xkbcommon` library to be installed:\n- `sudo apt install libxkbcommon-dev`\n\n# Features\n\nAdditional features can be enabled. These features can be added to the mode above with commas, e.g. `cargo run --features tokio,windowed`\n\n- `windowed`: Will run pixelflut in a windowed mode instead of on a linux framebuffer. On windows this flag is required.\n- `memory-cache`: Will use a memory cache to lookup values. This uses a large amount of memory (at least 4GB is recommended) and is currently slower than no memory cache\n\n# Recording metrics\n\n## Network traffic\n\nFor recording network traffic you can use `tcpdump`.\n\n```bash\nsudo tcpdump port 1234 -w tcpdump.capture\n```\n\nThen you can read this with\n```bash\nsudo tcpdump -r tcpdump.capture\n```\n\n## Performance\n\nPerformance can be recorded and viewed with [flamegraph](https://github.com/flamegraph-rs/flamegraph)\n\n```bash\n# For ubuntu\nsudo apt install linux-tools-common linux-tools-generic linux-tools-`uname -r`\ncargo install flamegraph\n\n# permissions\nsudo usermod -aG video $USER # enables framebuffer for non-sudo accounts\necho -1 | sudo tee /proc/sys/kernel/perf_event_paranoid # enables perf for non-sudo accounts\n```\n\nThen run\n\n```bash\nflamegraph ./target/release/pixelflut \u003cargs\u003e\n```\n\nThe flamegraph will be expored as `flamegraph.svg`\n\n# Issues and server configuration\nSeveral issues can occur when running the server. These issues are outlined below. When you encounter an issue while running this server, please let us know.\n\nthe `max-threads` mode can quickly run your operating system out of usable handles. On linux, you'll most likely want to use [sysctl](http://man7.org/linux/man-pages/man8/sysctl.8.html) for this.\n\nWhen running the screen on a linux framebuffer, the cursor is not hidden by default. You can run the following command to hide the cursor:\n- On the current screen: `echo -n -e '\\e[?17;14;224c'`\n- On a different TTY screen: `echo -n -e '\\e[?17;14;224c' \u003e dev/ttyX`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorkoenders%2Fpixelflut","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorkoenders%2Fpixelflut","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorkoenders%2Fpixelflut/lists"}