db4o客户端/服务器似乎一次只能处理一个查询?

时间:2022-04-01 07:09:08

We're evaluating db4o (an OO-DBMS from http://www.db4o.com). We've put together a performance test for client/server mode, where we spin up a server, then hammer it with several clients at once. It seems like the server can only process one client's query at a time.

我们正在评估db4o(来自http://www.db4o.com的OO-DBMS)。我们已经针对客户端/服务器模式进行了性能测试,我们将服务器启动,然后立即与几个客户端进行对话。看起来服务器一次只能处理一个客户端的查询。

Have we missed a configuration switch somewhere that allows for this scenario? Server implementation is below. The client connects, queries (read-only), and disconnects per operation, and operations run one immediately after the other from several worker threads in the client process. We see same behaviour if we spin up one client process with one worker each against the same server.

我们是否错过了允许这种情况的配置开关?服务器实现如下。客户端连接,查询(只读)和断开每个操作,并且操作在客户端进程中的多个工作线程之后立即运行。如果我们将一个客户端进程分别针对同一个服务器,则我们会看到相同的行为。

Any suggestions?

Edit: We've now discovered, and tried out, the Lazy and Snapshot QueryModes, and although this alleviates the blocking server problem (partially), we still see significant concurrency problems when our clients (we run 40 concurrent test-clients that wait 1-300ms before issuing a random operation-request) hammer on the server. There appear to be exceptions emanating from the LINQ provider and from the IO internals :-(

编辑:我们现在已经发现并尝试了Lazy和Snapshot QueryModes,虽然这可以缓解阻塞服务器问题(部分),但是当我们的客户端(我们运行40个等待1的并发测试客户端)时,我们仍然会看到严重的并发问题在发出随机操作请求之前-300ms锤击服务器。似乎有来自LINQ提供程序和IO内部的异常:-(

public class Db4oServer : ServerConfiguration, IMessageRecipient
{
    private bool stop;

    #region IMessageRecipient Members

    public void ProcessMessage(IMessageContext con, object message)
    {
        if (message is StopDb4oServer)
        {
            Close();
        }
    }

    #endregion

    public static void Main(string[] args)
    {
        //Ingestion.Do();
        new Db4oServer().Run(true, true);
    }

    public void Run(bool shouldIndex, bool shouldOptimizeNativeQueries)
    {
        lock (this)
        {
            var cfg = Db4oFactory.NewConfiguration();
            if (shouldIndex)
            {
                cfg.ObjectClass(typeof (Sequence))
                               .ObjectField("<ChannelID>k__BackingField")
                               .Indexed(true);
                cfg.ObjectClass(typeof (Vlip))
                               .ObjectField("<ChannelID>k__BackingField")
                               .Indexed(true);
            }
            if (shouldOptimizeNativeQueries)
            {
                cfg.OptimizeNativeQueries(true);
            }

            var server = Db4oFactory.OpenServer(cfg, FILE, PORT);
            server.GrantAccess("0", "kieran");
            server.GrantAccess("1", "kieran");
            server.GrantAccess("2", "kieran");
            server.GrantAccess("3", "kieran");
            //server.Ext().Configure().ClientServer().SingleThreadedClient(false);
            server.Ext().Configure().MessageLevel(3);
            server.Ext().Configure().Diagnostic().AddListener(new DiagnosticToConsole());
            server.Ext().Configure().ClientServer().SetMessageRecipient(this);
            try
            {
                if (!stop)
                {
                    Monitor.Wait(this);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
            }
            server.Close();
        }
    }

    public void Close()
    {
        lock (this)
        {
            stop = true;
            Monitor.PulseAll(this);
        }
    }
}

1 个解决方案

#1


1  

Well, there is something on the db40 servers that doesn't allow too many clients on at a time since it is too much for some to handle. You also locked it which did nothing to help in this case.

好吧,db40服务器上有一些东西,一次不允许太多客户端,因为它对于某些人来说太多了。您也锁定了它,在这种情况下没有任何帮助。

#1


1  

Well, there is something on the db40 servers that doesn't allow too many clients on at a time since it is too much for some to handle. You also locked it which did nothing to help in this case.

好吧,db40服务器上有一些东西,一次不允许太多客户端,因为它对于某些人来说太多了。您也锁定了它,在这种情况下没有任何帮助。