基于centos 7 构建
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
yum install -y gmp-devel
yum install -y pcre-devel
The program 'mysql_config' is required but it could not be found
yum install -y mariadb-devel
禁用aesni
cabal build all --constraint="cryptonite -support_aesni"
注意版本问题,此方法可能会太低了
The program 'pg_config' is required but it could not be found
yum install -y postgresql-devel
yum install -y unixODBC-devel
yum install -y libstdc++-devel libstdc++-static gcc-c++ ncurses-devel
git clone https://github.com/hasura/graphql-engine.git
cd graphql-engine/server
cabal build all --constraint="cryptonite -support_aesni"
适合内存不够用的场景,通过swap 解决,就是构建会比较慢,实际推荐使用一台配置比较好的机器构建(cpu,内存,以及磁盘)
dd if=/dev/zero of=/var/swapfile bs=1G count=10
mkswap /var/swapfile
swapon /var/swapfile
/etc/fstab
/var/swapfile swap swap defaults 0 0
vim /etc/sysctl.conf
vm.swappiness = 60
sysctl -p
默认没有开启profile 我们可以通过手工开启,方便性能优化
server/graphql-engine.cabal
flag profiling
description: Configures the project to be profiling-compatible
default: True
manual: True
以上是一个构建实践说明,推荐还是使用高版本的系统haskell 构建问题是不少,因为对于haskell 不是很了解,性能参数上边的还需要研究下
https://gmplib.org/
https://www.haskell.org/ghcup/install/
https://github.com/hasura/graphql-engine
https://github.com/haskell-crypto/cryptonite
https://github.com/input-output-hk/cardano-node/issues/1747
https://www.haskell.org/ghcup/install/
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/rts/config
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/profiling.html#prof-compiler-options
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/debug-info.html#implementor-s-notes-dwarf-annotations
https://github.com/fpco/ghc-prof-flamegraph
https://www.fpcomplete.com/blog/2015/04/ghc-prof-flamegraph/
https://downloads.haskell.org/~ghc/9.2.3/docs/html/users_guide/profiling.html
https://www.tweag.io/blog/2020-01-30-haskell-profiling/
http://cnhaskell.com/chp/25.html