SamuKata
soruly
soruly

patreon


Simplifying trace.moe system

To make it easy for everyone to run their own trace.moe system. I've simplified the system architecture by merging the workers and media server into a single api server.

The existing system is designed to distribute various tasks to remote machines so that compute-heavy tasks like hashing can be done on separate computers. This was to ensure loads are distributed to various servers to improve performance. However, over the past few years it seems that a single node is already powerful enough that everything (api server, media server, worker nodes) can all be run on the same node.

Running a distributed system on a single node seems unnecessarily complex and causing some network overhead on the same host. It was also wasting up to 1GB memory due to creating up-front process in cluster mode, which does nothing but waiting for jobs. Now I've re-written part of the code with async process and worker threads, so process are now spawn on-demand.

The repository of trace.moe-worker and trace.moe-media are archived as they are already integrated into trace.moe-api. I've also dropped redis and made sqlite an option for database. So instead of spinning up 9 different docker containers, now you only need 3 to run trace.moe locally. I have also tested that the system can run on windows using WSL2. If you're interested in setting up your own system, please refer to the Github link below.

https://github.com/soruly/trace.moe

Lastly, I'd like to say thanks to Vankerkom who helps me to optimize the system. Image search is now faster by using better ways to process the search image before searching. And I've also increased the search queue a little bit and since then not a single search was rejected due to server overload over last two weeks.


More Creators