Archived
This forum has been archived. Please start a new discussion on GitHub.
How to drive thousands of files with Evictor ?
To test the ablility of evictor to support thousands of files, I change the demo code in ICE_HOME/demo/Freeze/phonebook/Server.cpp as following:
When I run the demo with Ice-3.0.1-VC60, the demo can only drive 493 files and abort with "Lock table is out of available locks " message. What cause this problem?
Thanks
I set the DB_CONFIG file and copy it in ICE_HOME/demo/Freeze/phonebook/db...
...
Freeze::EvictorPtr evictor = Freeze::createEvictor(adapter,_envName, "contacts", 0, indices);
adapter->addServantLocator(evictor, "contact");
for(int i=0;i<1000;++i)
{
char buff[100];
sprintf(buff,"file%d",i);
Freeze::EvictorPtr temEvictor = Freeze::createEvictor(adapter, _envName, string(buff));
adapter->addServantLocator(temEvictor, string(buff));
}
...
...
set_lk_max_lockers 40000
set_lk_max_locks 40000
set_lk_max_objects 40000
set_lg_regionmax 2400000
set_cachesize 0 104857600 1
When I run the demo with Ice-3.0.1-VC60, the demo can only drive 493 files and abort with "Lock table is out of available locks " message. What cause this problem?
Thanks
0
Comments
-
make the Signature done0
-
Why would you want to create hundreds or thousands of Evictors?
It's like creating hundreds or thousands of tables in a relational database; why would you do it? Do you have hundreds of different types? This sounds quite unlikely.
In any case, you can create more Evictors by tweaking the Berkeley DB configuration file. See this thread for details.
Best regards,
Bernard0 -
My DB_CONFIG as following:set_lk_max_lockers 40000
set_lk_max_locks 40000
set_lk_max_objects 40000
set_lg_regionmax 2400000
set_cachesize 0 104857600 1
The reason that I want to create thousands of files with Evictors is:
1. I can't use a relational database,such as SQL SERVER, because my client need be support by database too and I want to use the same code both in server and client.
2. My current slice look like:class IKLine
{
long time;
long high;
long open;
long close;
long low;
long vol;
some access functions
};
If I want to drive all stocks with one file, I have to change the slice like:class IKLine
{
string stockName;
long time;
long high;
long open;
long close;
long low;
long vol;
some access functions
};0 -
I strongly recommend to use a single class / Evictor for all your stocks.
Which flexibilility do you loose with a single Evictor?
Cheers,
Bernard0 -
yeah,you remind me another way! Thanks a lot!All the reason that I choose the current awkward design is I did not understand the the use of indices clearly when I learned ICE a year ago.
I plan to change my slice like this:struct ITitle
{
string stockName;
long time;
};
class IKline
{
ITitle title;
long high;
long open;
long close;
long low;
long vol;
};
1.How to index title with descending order ? since there is findFirst(member-type index, int firstN) function in ICE but no findlast function.
2. For given stockName, how to find all the records whose x<title.time&&title.time<y ?0 -
kingbo wrote:1.How to index title with descending order ? since there is findFirst(member-type index, int firstN) function in ICE but no findlast function.
2. For given stockName, how to find all the records whose x<title.time&&title.time<y ?
The Freeze Evictor does not offer any form of sorting. firstFirst() simply returns the identities of up to n objects whose member matches exactly the given parameter.
Freeze Maps offer more powerful indexing features, including sorting; if you switch to a Freeze Map, you could create a sorted index on your title to perform range-queries.
Cheers,
Bernard0 -
Thanks for your suggestion.
I will review the chapter of Freeze Map and try it.0 -
Note that there are also newsletter articles on this topic.0