Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sqlite 会出现错误,换成其它如sqlserver 即不会 #13

Open
alanchen78 opened this issue Oct 11, 2022 · 5 comments
Open

Sqlite 会出现错误,换成其它如sqlserver 即不会 #13

alanchen78 opened this issue Oct 11, 2022 · 5 comments

Comments

@alanchen78
Copy link

889aa6e322fb3b37226b263994f7bc6

Sqlite 会出现上面错误。
换成其它如sqlserver 即不会。

@2881099
Copy link
Owner

2881099 commented Oct 11, 2022

FreeSqlBuilder() 代码发一下,max pool size=100 设置一下。

@alanchen78
Copy link
Author

        _fsql = new FreeSql.FreeSqlBuilder()
            .UseConnectionString(FreeSql.DataType.Sqlite, "data source=test.db;max pool size=100")
            .UseAutoSyncStructure(true)
            .UseNoneCommandParameter(true)
            .UseMonitorCommand(cmd => Console.WriteLine($"=========sql: {cmd.CommandText}\r\n"))
            .Build();

@2881099
Copy link
Owner

2881099 commented Oct 11, 2022

任何数量有多少个,每秒执行的数量,太多了这里有可能处理不过来。

@alanchen78
Copy link
Author

200多个吧,实线上线可能有上千个,是不是只要同一秒不是太多就可以了? 不超过多少就不会有问题?

@2881099
Copy link
Owner

2881099 commented Oct 12, 2022

200多个任务同一秒触发的话,对于数据库持久化是有压力的。

另外,任务最好默认串行,不要在 OnExecuting 内使用异步等方式执行任务体,那样可以前一个任务体未执行完,后一个任务又来了。

量大的持久化,可以考虑换性能高一点的数据库,或者换 redis 持久化。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants