Concurrent Problem For Help
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 18.4k
- Forks
- 3.7k
- Avg merge
- 5h 8m
- Merged PRs (30d)
- 1
Description
Hi, I have some problem when using dotnet Core 2.2 + Dapper to construct a Project.
Problem1: In the beginning of the month, a huge number of requests coming into our program (mostly simple QUERY, some flexible QUERY ——about 20-40second, and a little INSERT or UPDATE), and MySQL's perform becoming pool, and soon causing error like "too many connections". I don't understand what may cause these problems. Too High Concurrent request? or these slow SQL. My Code like this:
public IDbConnection GetDbConnection(){
Dapper.DefaultTypeMap.MatchNamesWithUnderscores = true;
var connectStr = "Database=xxx;Data Source=xxx;pooling=false;port=3306;Password=xxxx;";
return new MySqlConnection(connectStr)
}
with usage:
string strQuerySql = "select * from blablabla where xxx = xxx";
using(var connection = GetReadDbConnection()){
var listData = connection.Query<xxxModel>(strQuerySql).ToList();
}
is there anything wrong?
Problem2:If I wanna using connection pool, I just need to modify my connectStr like this:
var connectStr = "Database=xxx;Data Source=xxx;pooling=true;port=3306;Password=xxxx;min pool size = 10;max pool size = 150;";
is that Right?
Expecting your reply ! Thank you so much.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue provides a C# connection factory, a MySQL connection string, and a Dapper query example, but names no repository files or tests. Start by reviewing the reported connection-pooling configuration and reproducing the high-concurrency behavior; done would require a clear diagnosis and an agreed project change, neither of which is specified here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, mysql
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100