Giter Club home page Giter Club logo

Comments (11)

matpow2 avatar matpow2 commented on August 20, 2024

I can't seem to reproduce this. What fds are open when this happens?

from cuwo.

Kainzo avatar Kainzo commented on August 20, 2024

Can you tell me how to see what FDS are open? I'm on Debian 8. I'm familiar with most things but not familiar with what you're wanting exactly.

from cuwo.

Kainzo avatar Kainzo commented on August 20, 2024

That's my first thought, Cubexed - we have a ton of files on the server but the limit is very high.

from cuwo.

Jakky89 avatar Jakky89 commented on August 20, 2024

Already implemented SQLite storage actually used for storing user data and bans in my forge that maybe will be merged.

from cuwo.

matpow2 avatar matpow2 commented on August 20, 2024

I think the banlist.dat issue is caused by a machine with too many file descriptors open, and I doubt it's caused by cuwo. The only file descriptors it opens (excluding the ones used by Python) are banlist.dat, the IRC connection and the connections to the client, so I suspect it's something on Kainzo's machine.
Also, we are not going to use SQLite for databases for ban.py. Python dicts will work fine for our purposes.

from cuwo.

matpow2 avatar matpow2 commented on August 20, 2024

The file is closed in any case after fp goes out of scope due to the GC (even though the 'with' statement will close it - there's a reason we use it versus open()). load_data() is not the culprit, and I'm pretty sure it's a fault on Kainzo's machine.

Closing for the time being. Kainzo, feel free to ping me if you still think this is an issue in cuwo after testing on a new user on your box. Thanks.

from cuwo.

Jakky89 avatar Jakky89 commented on August 20, 2024

Yes, using SQLite database instead solves all these issues without changing system configuration (increasing the amount of file descriptors) and has many more advantages when you e.g. have to find out if player x has been banned with thousands of entries in banlist.dat you can instead use a simple SELECT query.

Increasing the amount of maximum open file descriptors also should help in the case you are handling lots of files that are open at the same time.

from cuwo.

matpow2 avatar matpow2 commented on August 20, 2024

SQLite doesn't fix anything, and it would be an unnecessary dependency for the project. Python's dict implementation is fast, so there's no need for some retarded database library when it only contains a couple of thousand entries.

from cuwo.

Jakky89 avatar Jakky89 commented on August 20, 2024

The SQLite library is included in pythons default libraries.

from cuwo.

matpow2 avatar matpow2 commented on August 20, 2024

I did not realize that - my bad. But in any case, we should language-native types instead of a database library, as a database library is added complexity that comes with absolutely no gains (no, it does not improve performance if we're talking just a couple of thousand entries). Dictionaries are fine. You could consider writing a script that uses SQLite, but it should not be in the core server.

from cuwo.

Jakky89 avatar Jakky89 commented on August 20, 2024

Nope. It is more complex when you need to write own database-like functionality than using an existing free, reliable, well known and fast database engine. Using a database engine gives more flexibility.

from cuwo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.