Results 1 to 9 of 9

Thread: How to drive thousands of files with Evictor ?

  1. #1
    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
    16

    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:
    ...
    ...
    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
    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

  2. #2
    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
    16
    make the Signature done
    Tang Fan
    ShenZhen Yijin Platform Network Technology Co.,Ltd
    Project: Stock quotation server

  3. #3
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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.

  4. #4
    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
    16
    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
    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:
    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:
    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

  5. #5
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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.

  6. #6
    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
    16
    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;

    };
    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

  7. #7
    bernard's Avatar
    bernard is offline ZeroC Staff
    Name: Bernard Normier
    Organization: ZeroC, Inc.
    Project: Ice
    Join Date
    Feb 2003
    Location
    Palm Beach Gardens, FL
    Posts
    1,294
    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.

  8. #8
    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
    16
    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

  9. #9
    matthew's Avatar
    matthew is offline ZeroC Staff
    Name: Matthew Newhook
    Organization: ZeroC, Inc.
    Project: Internet Communications Engine
    Join Date
    Feb 2003
    Location
    NL, Canada
    Posts
    1,458
    Note that there are also newsletter articles on this topic.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem including files in ice files
    By teoMalo in forum Help Center
    Replies: 4
    Last Post: 09-21-2009, 11:33 AM
  2. Trouble when using Evictor!
    By kent in forum Help Center
    Replies: 7
    Last Post: 04-12-2006, 09:14 PM
  3. Windows Installer assumes System Drive is on C:
    By RyanFogarty in forum Comments
    Replies: 5
    Last Post: 02-08-2005, 07:19 AM
  4. Evictor problem
    By xdm in forum Help Center
    Replies: 11
    Last Post: 10-14-2003, 01:32 PM
  5. evictor question
    By xdm in forum Help Center
    Replies: 1
    Last Post: 09-14-2003, 01:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •