Optional ignoring of RegBase autosave
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Optional ignoring of RegBase autosave

Started by WAJIM, 08 January, 2010, 15:56:48

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

WAJIM

After calling RegMan.AddReg/DelReg/ChangeReg funtions HUB automatically call RegMan.Save function to save base on HDD.

When I calling RegMan.DelReg on my HUB with RegBase ~5000 users, removal of Regs works very slowly (~5 Regs/second) because of write of base on a HDD after every DelReg.

I suggest to make optional ignoring of autosave RegBase after RegMan.AddReg/DelReg/ChangeReg funtions.

Example: RegMan.DelReg(sNick, bNoSave) or RegMan.DelRegFast(sNick)

Enuri

Agree with WAJIM. Recently i removed about ~8000 regs, i had use timer to clear reg base on working hub.

Also, i don't want to create a new topic, so how about make a ProfMan.Save() function? Now only shutdown or restart saves profiles.

Enuri

Quote from: Mutor on 08 January, 2010, 16:38:41
Why would you delete 8000 registered accounts?
I see no practical or reasonable cause for this.
Just to delete regs that are not used for a long time... Less regs gives a best performance, i think :)

WAJIM

#3
Quote from: Mutor on 08 January, 2010, 16:38:41
Why would you delete 8000 registered accounts?
No, every month invokes purging function, that removes unused accounts, ~100-300.  ::)

QuoteAnd if the hub should fail by script or system issues before a save is made
These are my problems.  :P

Enuri

#4
Quote from: Mutor on 08 January, 2010, 16:57:21dump 8k users at once is foolish.
Yes. But it's first time when i clear my reg base  ;D

So, if some linux user needs this function now:

0) Create a backup  ;D
1) open src/LuaRegManLib.cpp
2) Find function started with static int DelReg(lua_State * L)
3) Copy this function with new name like static int DelRegFast(lua_State * L)
4) Delete hashRegManager->Save(); in the end of the function
5) Find static const luaL_reg regman_funcs[] =  {
6) Add { "DelRegFast", DelRegFast }, to this array
7) Compile and enjoy :)

WAJIM

Quote from: Mutor on 08 January, 2010, 16:57:21
but it would seem your problems and WAJIM's may well be due to poor scripting methods.
No, I well see, how the size of RegisteredUsers.xml changes in a range from 0 up to 800K many times when I make many RegMan.DelReg calls.

Enuri

Quote from: Mutor on 08 January, 2010, 17:05:03Add to that the risk of losing changes made on crash
Following this logic, why settings and bans aren't saved automatically after calling SetMan.Set... ?

Quote from: Mutor on 08 January, 2010, 17:05:03
. Is everyone in Russia crazy?  :P
Oh, yes  ;D

WAJIM

Quote from: Mutor on 08 January, 2010, 17:08:23
Well that's the point, properly coded, you would never BE making many DelReg calls.
No, simply the hub should process function correctly, instead of through an ass.  :-*

QuoteThe xml file will be the size it needs to be when you're done fucking with it.
Is it any wonder the file size changes when it's being re-written?
Therefore I have created this topic. For improvement of work with database.

For what purposes there is a function RegMan.Save() ?!  ???

WAJIM

Quote from: Enuri on 08 January, 2010, 16:59:43
So, if some linux user needs this function now:
Thanks, but I'm win32 user.  :-\

PPK

#9
Quote from: Mutor on 08 January, 2010, 17:05:03
Is everyone in Russia crazy?  :P
YES! ;D


Problem fixed, removed auto save. From PtokaX 0.4.1.2 it will be scripter responsibility to save regs when it is needed :P
"Most of you are familiar with the virtues of a programmer. There are three, of course: laziness, impatience, and hubris." - Larry Wall

WAJIM


SMF spam blocked by CleanTalk