Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 05-18-2006
kingbo kingbo is offline
Registered User
 
Name: Tang Fan
Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
 
Join Date: Jul 2005
Posts: 15
Send a message via MSN to kingbo
-->
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:
Quote:
...
...
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));
}
...
...
I set the DB_CONFIG file and copy it in ICE_HOME/demo/Freeze/phonebook/db
Quote:
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
Reply With Quote
  #2 (permalink)  
Old 05-18-2006
kingbo kingbo is offline
Registered User
 
Name: Tang Fan
Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
 
Join Date: Jul 2005
Posts: 15
Send a message via MSN to kingbo
-->
make the Signature done
__________________
Tang Fan
ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
Reply With Quote
  #3 (permalink)  
Old 05-18-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 834
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,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #4 (permalink)  
Old 05-18-2006
kingbo kingbo is offline
Registered User
 
Name: Tang Fan
Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
 
Join Date: Jul 2005
Posts: 15
Send a message via MSN to kingbo
-->
My DB_CONFIG as following:
Quote:
set_lk_max_lockers 40000
set_lk_max_locks 40000
set_lk_max_objects 40000
set_lg_regionmax 2400000
set_cachesize 0 104857600 1
I copyed the DB_CONFIG file to ICE_HOME/demo/Freeze/phonebook/db,but can not slove the problem.

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:
Quote:
class IKLine
{
long time;
long high;
long open;
long close;
long low;
long vol;

some access functions
};
I plan to index the table with time field and name every file with stock name. Since there are thousands of stocks , I need to create thousands of files with Evictors.
If I want to drive all stocks with one file, I have to change the slice like:
Quote:
class IKLine
{
string stockName;
long time;
long high;
long open;
long close;
long low;
long vol;

some access functions
};
However Berkeley DB does not support sql language. In this case, I will lose some flexibilities.
__________________
Tang Fan
ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
Reply With Quote
  #5 (permalink)  
Old 05-18-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 834
I strongly recommend to use a single class / Evictor for all your stocks.

Which flexibilility do you loose with a single Evictor?

Cheers,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #6 (permalink)  
Old 05-18-2006
kingbo kingbo is offline
Registered User
 
Name: Tang Fan
Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
 
Join Date: Jul 2005
Posts: 15
Send a message via MSN to kingbo
-->
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:

Quote:
struct ITitle
{
string stockName;
long time;
};

class IKline
{
ITitle title;
long high;
long open;
long close;
long low;
long vol;

};
And index the table with title field.In this design, I am still puzzled by the following questions about the use of ndices :
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 ?
__________________
Tang Fan
ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
Reply With Quote
  #7 (permalink)  
Old 05-18-2006
bernard's Avatar
bernard bernard is offline
ZeroC Staff
 
Name: Bernard Normier
Organization: ZeroC, Inc.
Project: Ice
 
Join Date: Feb 2003
Location: Palm Beach Gardens, FL
Posts: 834
Quote:
Originally Posted by kingbo
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,
Bernard
__________________
Bernard Normier
ZeroC, Inc.
Reply With Quote
  #8 (permalink)  
Old 05-18-2006
kingbo kingbo is offline
Registered User
 
Name: Tang Fan
Organization: ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
 
Join Date: Jul 2005
Posts: 15
Send a message via MSN to kingbo
-->
Thanks for your suggestion.
I will review the chapter of Freeze Map and try it.
__________________
Tang Fan
ShenZhen Yijin Platform Network Technology Co.,Ltd
Project: Stock quotation server
Reply With Quote
  #9 (permalink)  
Old 05-19-2006
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,088
Note that there are also newsletter articles on this topic.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble when using Evictor! kent Help Center 7 04-12-2006 10:14 PM
Evictor question? thelONE Help Center 2 10-27-2005 08:34 AM
Windows Installer assumes System Drive is on C: RyanFogarty Comments 5 02-08-2005 08:19 AM
Evictor problem xdm Help Center 11 10-14-2003 02:32 PM
evictor question xdm Help Center 1 09-14-2003 02:11 AM


All times are GMT -4. The time now is 12:22 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.