chilly-nightfall-44799
01/03/2025, 11:10 PMbrief-egg-61061
01/03/2025, 11:10 PMbrief-egg-61061
01/03/2025, 11:10 PMchilly-nightfall-44799
01/06/2025, 3:28 PMbrief-egg-61061
01/06/2025, 3:28 PMbrief-egg-61061
01/06/2025, 3:28 PMBCRYPT_COST
. According to the [Performance and benchmarks documentation](https://www.ory.sh/docs/ecosystem/benchmark), for their benchmarks, they've set BCRYPT_COST=8
. 2. Character Limit: BCrypt has a maximum length of 72 bytes for passwords. As mentioned in the [BCrypt secret length troubleshooting guide](https://www.ory.sh/docs/troubleshooting/bcrypt-secret-length), "BCrypt hashed passwords and secrets have a 72 character limit. This is a limitation of the BCrypt algorithm and the Golang BCrypt library." While this doesn't directly cause slowness, it's an important factor to be aware of. 3. Debugging Approach: To debug the slow registration process, you might want to: - Check your BCRYPT_COST
setting and consider lowering it if it's set too high. - Monitor your system resources during registration to see if there are any bottlenecks. - Use logging or profiling tools to identify where the slowdown is occurring in the registration process. 4. Configuration Check: Review your Kratos configuration to ensure there are no misconfigurations causing the slowdown. The [Kratos configuration documentation](https://www.ory.sh/docs/kratos/reference/configuration) might be helpful for this. If you're still experiencing significant slowdowns after checking these factors, it might be worth investigating other parts of your system or considering reaching out to the Ory community for more specific assistance, as the provided knowledge sources don't contain more detailed information about BCrypt-specific performance issues in Kratos.chilly-nightfall-44799
01/06/2025, 3:53 PMbrief-egg-61061
01/06/2025, 3:53 PMbrief-egg-61061
01/06/2025, 3:53 PMyaml hashers: argon2: parallelism: 1 memory: 128MB iterations: 3 salt_length: 16 key_length: 32
It's important to note that if you decide to switch to Argon2id, you should carefully consider the parameters to ensure a balance between security and performance. Ory provides a CLI tool to help calibrate these parameters for your specific environment, as mentioned in the [Argon2 password hashing parameters guide](https://www.ory.sh/docs/kratos/guides/setting-up-password-hashing-parameters).chilly-nightfall-44799
01/06/2025, 6:17 PMbrief-egg-61061
01/06/2025, 6:17 PMbrief-egg-61061
01/06/2025, 6:18 PMchilly-nightfall-44799
01/06/2025, 6:18 PMbrief-egg-61061
01/06/2025, 6:19 PMbrief-egg-61061
01/06/2025, 6:19 PMtime=2024-10-17T11:08:23Z level=info msg=completed handling request ... took:2.981164ms]
These log entries can help you identify which parts of the request handling process are taking the most time. 4. Use Profiling Tools: While not explicitly mentioned in the provided knowledge sources for Kratos, using Go's built-in profiling tools or third-party profilers can provide detailed information about CPU and memory usage, which can help identify performance bottlenecks. By implementing these methods, particularly distributed tracing, you should be able to get a much clearer picture of how Kratos is spending its time in fulfilling requests, allowing you to identify and address any performance issues more effectively.chilly-nightfall-44799
01/06/2025, 8:25 PMbrief-egg-61061
01/06/2025, 8:25 PMbrief-egg-61061
01/06/2025, 8:26 PMDSN=memory
This is useful for quick setups but remember that all data is ephemeral and will be removed when the service is stopped [Deployment Fundamentals and Requirements](https://www.ory.sh/docs/self-hosted/deployment). 2. SQLite: For SQLite, the DSN should be prefixed with "sqlite://". For example: DSN=sqlite:///tmp/some-db.sqlite?_fk=true
Note that the _fk=true
parameter is required for foreign keys to work [Deployment Fundamentals and Requirements](https://www.ory.sh/docs/self-hosted/deployment). 3. PostgreSQL: For PostgreSQL, the DSN should be prefixed with "postgres://". For example: DSN=<postgres://user:password@host:123/database>
PostgreSQL supports additional parameters like max_conns
, max_idle_conns
, max_conn_lifetime
, sslmode
, etc. [Deployment Fundamentals and Requirements](https://www.ory.sh/docs/self-hosted/deployment). 4. MySQL: While not explicitly shown in the provided sources, MySQL is supported. The DSN format would be similar to PostgreSQL but with a "mysql://" prefix. 5. CockroachDB: For CockroachDB, the DSN should be prefixed with "cockroach://". For example: DSN=<cockroach://user:password@host:123/database>
CockroachDB also supports additional parameters like sslmode
, application_name
, etc. [Deployment Fundamentals and Requirements](https://www.ory.sh/docs/self-hosted/deployment#cockroachdb). When setting up Kratos, you can specify the DSN in your configuration file or as an environment variable. For example, in a Docker setup, you might see something like this: yaml environment: - DSN=<postgres://kratos:secret@postgresd:5432/kratos?sslmode=disable&max_conns=20&max_idle_conns=4>
Remember to choose the appropriate DSN based on your database setup and requirements. Also, it's crucial to run SQL migrations when setting up or upgrading your database, which can be done using the kratos migrate sql
command [Kratos migrate sql](https://www.ory.sh/docs/kratos/cli/kratos-migrate-sql).