Author Topic: ULX Lag when adding to any rank  (Read 5867 times)

0 Members and 2 Guests are viewing this topic.

Offline Jamster

  • Newbie
  • *
  • Posts: 9
  • Karma: 1
  • Oh... Hi :)
    • http://2swag4you.net
ULX Lag when adding to any rank
« on: January 23, 2016, 12:16:58 PM »
So, of recent my server has becoming increasingly laggy everytime one of my staff members adds someone to a group.

Now, the gamemode we are running is StarWarsRP on DarkRP base. This means each regiment has it's own "whitelist" in ULX. We'd rather not move to a custom whitelist system due to the need to re-add every user to their needed ranks etc. I'd like to know if there is some issue with the server or ULX as to why when adding someone to a new rank it causes server lag.

I appreciate that's confusing af but it's late, I am tired and might re-type this later.... :3

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX Lag when adding to any rank
« Reply #1 on: January 23, 2016, 12:28:11 PM »
If you have a large number of users in users.txt, it will take some time to write the file. Unfortunately, we have no good news there; we have wanted to port the user and group data to SQLite, but it's not likely to happen in the near future.

I've never heard of StarWarsRP before, and I'm not sure why you need to whitelist each player. Perhaps someone in the Ulysses community can offer an alternative.
Experiencing God's grace one day at a time.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: ULX Lag when adding to any rank
« Reply #2 on: January 23, 2016, 12:43:11 PM »
Not to be rude, but is there a specific reason you aren't going to be porting user and group data to SQLite in the near future? If it's just because of a lack of time I'd be happy to have a go at it and do a pull request.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX Lag when adding to any rank
« Reply #3 on: January 23, 2016, 01:22:43 PM »
A few reasons...

1. When we designed UCL, we never intended people to add every single user to join. I still don't see why people are doing this, though we definitely empathize that if you want to do so, ULib is not your friend. However, since a minority of users are doing this, it is not a priority change for us.
2. Time, though secondary to #1.
3. We are trying to shift efforts to ULX4. Any time spent doing this is time not spent working on ULX4 -- and because of #1, ULX4 is more important to us.

We'd definitely appreciate a code donation to do this, though it's not as straightforward as you may think. Our requirements would be the following:
1. Match our code style (in particular, no Garry'isms that break normal Lua conventions).
2. Import anything from the current users.txt and groups.txt once.
3. Able to recover from errors/misconfiguration in the database.
Experiencing God's grace one day at a time.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Lag when adding to any rank
« Reply #4 on: January 23, 2016, 02:06:34 PM »
More simply, the original ULib (and the admin mod for ULib's group access controls, ULX) was never intended for so many 'jobs' or 'teams'.
It's meant primarily for a select few special trusted people to maintain a server, act as the server's police so to speak, in a few special groups.

Unfortunately for it's design, but fortunately for fans everywhere, due to how easy ULX is to maintain custom groups and users versus the lack of understanding of many of differences between 'group' administrative control and "team/job/role" access, many use ULib far beyond it's original purpose and make (too) many groups and add (too) many users to all those groups as "jobs".

We're looking towards the future, but the challenge still remains the same.

Jamster, back more on topic to your original question, how large are your /data/ULib users.txt and groups.txt?
How many users and groups do you have?
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Jamster

  • Newbie
  • *
  • Posts: 9
  • Karma: 1
  • Oh... Hi :)
    • http://2swag4you.net
Re: ULX Lag when adding to any rank
« Reply #5 on: January 23, 2016, 02:45:45 PM »
JamminR

The file sizes are as follow

Users.txt: 502.723KB
Groups.txt: 11.932KB

The total group number comes to around 53.... A lot more than I thought....
« Last Edit: January 23, 2016, 02:50:05 PM by Jamster »

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Lag when adding to any rank
« Reply #6 on: January 23, 2016, 03:30:52 PM »
As Megiddo states, the size of your users and groups file will cause lag.
Half a megabyte of users is, I think, huge.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Jamster

  • Newbie
  • *
  • Posts: 9
  • Karma: 1
  • Oh... Hi :)
    • http://2swag4you.net
Re: ULX Lag when adding to any rank
« Reply #7 on: January 23, 2016, 03:42:44 PM »
Hm.... I see...

So at current there is no way to really get around this?

I suppose then it would be smart for us to move to a dedicated whitelist system, rather than relying on the functionality of ULX for group management?

Offline Megiddo

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 6214
  • Karma: 394
  • Project Lead
Re: ULX Lag when adding to any rank
« Reply #8 on: January 23, 2016, 04:34:22 PM »
In this case, yes.
Experiencing God's grace one day at a time.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: ULX Lag when adding to any rank
« Reply #9 on: January 23, 2016, 05:30:28 PM »
We'd definitely appreciate a code donation to do this, though it's not as straightforward as you may think. Our requirements would be the following:
1. Match our code style (in particular, no Garry'isms that break normal Lua conventions).
2. Import anything from the current users.txt and groups.txt once.
3. Able to recover from errors/misconfiguration in the database.

I can do 1 and 2 fine, as I don't use Garry's additions to lua anyways. I'm not sure exactly what you mean by recover, but at the very least I can make sure that there are no lua errors if some of the database is edited incorrectly or becomes corrupt.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Jamster

  • Newbie
  • *
  • Posts: 9
  • Karma: 1
  • Oh... Hi :)
    • http://2swag4you.net
Re: ULX Lag when adding to any rank
« Reply #10 on: January 23, 2016, 06:06:30 PM »
Welp, my question is answered

^^ Love the way you've taken this off topic again... Makes me sad  :'( :'(

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: ULX Lag when adding to any rank
« Reply #11 on: January 23, 2016, 07:50:26 PM »
Welp, my question is answered

^^ Love the way you've taken this off topic again... Makes me sad  :'( :'(

I'm sorry, I was just discussing migrating the users.txt and groups.txt to SQL which is related to this thread and is something that would probably help you.

but, ya kno, watever
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Bite That Apple

  • Hero Member
  • *****
  • Posts: 858
  • Karma: 416
  • Apple Innovations 2010®
    • Fun 4 Everyone Gaming
Re: ULX Lag when adding to any rank
« Reply #12 on: January 24, 2016, 11:46:24 PM »
(in particular, no Garry'isms that break normal Lua conventions).

I'm not entirely sure what you mean by that, it caught my eye though. If I take a guess, I'd say majority of the "Releases" sectiom are Garry'isms.
Quote from: John F. Kennedy 1963
A man may die, nations may rise and fall, but an idea lives on.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: ULX Lag when adding to any rank
« Reply #13 on: January 25, 2016, 04:49:58 AM »
I'm not entirely sure what you mean by that, it caught my eye though. If I take a guess, I'd say majority of the "Releases" sectiom are Garry'isms.

Mostly operators and other stuff from C, like // comments, !=, ||, &&, etc.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULX Lag when adding to any rank
« Reply #14 on: January 25, 2016, 02:56:23 PM »
Mostly operators and other stuff from C, like // comments, !=, ||, &&, etc.
Yes, indeed.
From our Developers Corner "sticky" post 'Want to patch or work on a Ulysses project? Use our codestyle'

Absolutely no usage of garry's modifications to the language
This is a must. You should not use C-style comments "//" and/or "/*...*/", and you should not use the '!', '&&', '||' operators. These were all edited into the lua engine by garry, and non-standard. This means that any code written with these must be modified to work in any other project. This is simply unacceptable.

What about the binary operators '<<', '>>', and '~'? These operators actually serve a purpose and can be useful in certain situations. First, ask if it's absolutely necessary. Is there a way to do what you want another way without making the code more complicated? If the answer is no, then you can use these operators. Otherwise, find another way.

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming