Template:
- [x] task1
- [ ] task2
- [x] task3
- [ ] task4
Effect:
- task1
- task2
Template:
- [x] task1
- [ ] task2
- [x] task3
- [ ] task4
Effect:
考虑这个问题: 在Golang的函数中创建一个struct,然后将它return,这个struct的内存空间会被分配在哪里?return的时候会有哪些操作?是否会发生拷贝?
有关go内存是在堆上分配的,还是在栈上分配的,这个是在编译过程中,通过逃逸分析来确定的,其主体思想是: 假设有变量v,及指向v的指针p,如果p的生命周期大于v的生命周期,则v的内存要在堆上分配。 https://cloud.tencent.com/developer/article/1861199
小技巧:我们也可以在编译时,通过加上-m参数,来让编译器告诉我们,一个变量到底是分配在堆上,还是在栈上
| docker run --network host --rm \ | |
| apecloud/customsuites:latest \ | |
| sysbench \ | |
| --db-driver=mysql \ | |
| --report-interval=1 \ | |
| --tables=40 \ | |
| --table-size=250000 \ | |
| --threads=4 \ | |
| --time=10 \ | |
| --mysql-host=127.0.0.1 \ |
| Best kubernetes database operator: KubeBlocks | |
| https://github.com/apecloud/kubeblocks |
| # Install PostgreSQL on Kubernetes with KubeBlocks | |
| ## Introduction | |
| Managing databases on Kubernetes has always been a challenge—until **KubeBlocks** arrived! | |
| KubeBlocks provides a **unified API**, allowing you to manage **MySQL, PostgreSQL, MongoDB, Redis, Pulsar, ClickHouse**, and more in a consistent way without learning multiple database operation tools. | |
| In this tutorial, we will focus on **PostgreSQL** and demonstrate how to install and connect to a PostgreSQL database on Kubernetes using KubeBlocks. |