Hi, We have realized that most of the supertokens ...
# support-questions-legacy
h
Hi, We have realized that most of the supertokens methods in Go SDK takes multiple seconds to finish. We have tried multiple DB pool connection numbers but did not give use any performance benefits. Our DB is located on a remote server. But we also realized that the DB queries takes 0.0030 seconds averagely, which is quite good. Now we would like to troubleshoot and Isolate the problem to improve this performance. What is the best way to debug this issue? It might be a networking problem or a configuration problem but we are unsure how to isolate the problem. Imagine after the first 4 lines in the below method, all of the blocks take at least a second to complete. So imagine a simple GetUserInfo takes around 7 seconds to complete.
Copy code
func GetUserInfo(c *gin.Context) {

    sessionContainer := session.GetSessionFromRequestContext(c.Request.Context())
    sessionHandle := sessionContainer.GetHandle()
    tenantid := sessionContainer.GetTenantId()
    userIDfromSession := sessionContainer.GetUserID()

    userInfo, err := emailpassword.GetUserByID(userIDfromSession)
    if err != nil {
        sugar.Error(err)
    }
    createdTimestamp, err := sessionContainer.GetTimeCreated()
    if err != nil {
        sugar.Error(err)
    }
    metadata, err := usermetadata.GetUserMetadata(userIDfromSession)
    if err != nil {
        sugar.Error(err)
    }

    response, err := userroles.GetRolesForUser(tenantid, userIDfromSession, nil)
    if err != nil {

        sugar.Error(err)
    }
    for _, role := range response.OK.Roles {
        sugar.Info(role)
    }
    sugar.Info("special metadata objects")
    first_name := metadata["first_name"]
    sugar.Info(first_name)
    count, err := supertokens.GetUserCount(nil, &tenantid)
    if err != nil {
        sugar.Error(err)
    }
2 Views