Results 1 to 4 of 4
  1. #1
    Member
    Join Date
    Mar 2009
    Location
    Madrid
    Posts
    16

    How to control connections and items suscribed

    Hi,

    i've two questions about max number of connections and max number of suscribed items.

    1) CONNECTIONS:
    i've seen in the configuraction file the <max_clients> element, but i have a doubt. The commentary says that it is Highest number of concurrent connections allowed

    one connection is tha same that one user? or a user could have several connections opened?

    If i have a page with a stock list, and If i have this in my conf. file: <max_clients>50</max_clients>

    this means that only 50 users can see the updates in the page?


    2) SUSCRIBED ITEMS:
    how can i limit the suscribed items by user? and if i have a limit of 10, what will happen if a user try to suscribe to 15 items?

    Thanks.

  2. #2
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    About connections:
    The <max_clients> configuration element was introduced as a protection from overload, hence it is just a limit on the overall number of sockets currently open.
    This may depend on implementation details. For instance, control connections used for subscription requests are also included (hence, multiple connections are possible for a user).
    So, the setting is not meant as a limit on sessions and there is no guarantee on the number of concurrent sessions that can be reached.
    The setting will be deprecated in the next minor upgrade of Lightstreamer, where a <session> element will be finally introduced.

    About subscribed items:
    A limit on the subscriptions can be applied by the Metadata Adapter, by implementing notifyNewTables, notifyTablesClose and wantsTablesNotification properly.
    By throwing a CreditsException you can refuse the subscription of a new table. This applies to the whole table; you cannot accept only a subset of the involved items.
    The client is notified of the refusal. For instance, a web client gets an invocation of the onServerDeny callback with a 0 or negative error code.
    Note: notifyNewTables takes an array of tables, but you should expect only one table; only particular clients submit atomic requests for multiple tables.

  3. #3
    Member
    Join Date
    Mar 2009
    Location
    Madrid
    Posts
    16
    Ok, then... until you add the new <session> element , how can i limit opened sessions?. In my case, only a max numbers of concurrents users (1000) should can see the updates.; if the user 1001 try to open a new connection, it should be refused.

    Is there any way to know how many sessions are opened?

    Thanks.

  4. #4
    Administrator
    Join Date
    Jul 2006
    Location
    Milan
    Posts
    975
    The session limit can be imposed through the Metadata Adapter as well.
    Indeed, if the limit is a strict one and is not simply a protection limit, then the Metadata Adapter is the module that should be responsible for it.
    The notifyNewSession and notifySessionClose methods provide you with the ability of counting the sessions and blocking some of them.

    Consider that a strict control of the number of sessions is complicated by several factors.
    As you limit yourself to a single Server instance, this simplifies things significantly.
    However, there is no strict correspondance between sessions in the Server and instances of your application running on the browser, because
    • The life of a session in the Server can continue for some seconds after the client has closed or reloaded the application.
    • In case the Stream-sense mechanism comes into action, two sessions can be temporarily started before one is assigned to the application.
    Hence, you won't exceed 1000 sessions on the Server, but the real sessions may be a few less.
    Can you cope with this?

 

 

Similar Threads

  1. How to setup frequency control?
    By chanro4 in forum Client APIs
    Replies: 4
    Last Post: January 19th, 2011, 10:29 AM
  2. Multiple Connections
    By mnfjorge in forum Client APIs
    Replies: 1
    Last Post: March 24th, 2010, 09:52 AM
  3. Replies: 5
    Last Post: September 8th, 2009, 04:07 PM
  4. Multiple control.html requests
    By riwang in forum Client APIs
    Replies: 3
    Last Post: August 13th, 2009, 10:43 AM
  5. Replies: 2
    Last Post: March 5th, 2008, 07:29 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT +1. The time now is 09:31 PM.