Skip to content

Crash when try launch high load test #44

@sglushchenko

Description

@sglushchenko

Hello,

I have a crash when I try to make a test for high load.
I call ab -c 50 -n 10000 -f TLS1.2 -H "Accept-Encoding: gzip,deflate" http://127.0.0.1:8181/activities
in a command line and I have the crash in
PerfectMySQL->MySQLStmt.swift->line 218 let r = mysql_stmt_execute(ptr)
Crash is Thread 2: signal SIGABRT

I use Mac OS Majove,
Swift 4.2
PerfectMySQL 3.3.0

Maybe I wrong setup connect to a database?

part of my code:

//Connection to database
mySQL = MySQL()
let isConnected = mySQL.connect(host: testHost, user: testUser, password: testPassword, db: nil, port: testPort, socket: nil, flag: 0)
db = Database(configuration: MySQLDatabaseConfiguration(connection: mySQL))

//Code from handler
let result = try db.table(Activity.self).order(by: \Activity.updatedAt).limit(count, skip: from).select()
let activities: [[String: Any]] = result.map{
     $0.toJson()
}
let responseString = JSON(activities).rawString() ?? "[]"
response.appendBody(string: responseString).completed(status: .ok)

So the code is very simple. just select items from the database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions