freebsd

PostgreSQL In Memory Database

醉酒当歌 提交于 2019-12-02 17:12:39
I want to run my PostgreSQL database server from memory. The reason is that on my new server, I have 24 GB of memory, and hardly any of it is used. I know I can run this command to make a ramdisk: mdmfs -s 1024m md2 /mnt And I could theoretically have PostgreSQL store its data there. But the problem with this is that if the server crashes or reboots, the data will be gone. Basically, I want the database to be loaded in memory at all times so that it does not have to go to the hard disk drive to read every record, since I have TONS of memory and since memory is faster than hard disk drives. Is

How did WhatsApp achieve 2 million connections per server?

南笙酒味 提交于 2019-12-02 14:03:36
On Ubuntu, the maximum number of sockets which can be opened seems to be governed from following: $ cat /proc/sys/net/ipv4/tcp_max_orphans 262144 As per one of the presentations by Rick Reed (from WhatsApp), these guys took it up to 2 million concurrent connections on a "single server" using FreeBSD and ErLang. My understanding is that we will always need some support from the kernel. And yes, looks like the tweaked the FreeBSD to have this capability : hw.machine: amd64 hw.model: Intel(R) Xeon(R) CPU X5675 @ 3.07GHz hw.ncpu: 24 hw.physmem: 103062118400 hw.usermem: 100556451840 kb@c123$ uname

FreeBSD安装后使用su命令显示sorry的解决办法

一世执手 提交于 2019-12-02 13:02:36
FreeBSD中, 可以使用 su 命令成为 root 用户,但FreeBSD对执行su命令的用户进行了更严格的限制,能使用su命令的用户必须属于wheel组(root的基本属组,组ID为0),否则就不能通过 这个命令成为root。(当然该用户还得知道 root 口令) 因此需要编辑组设置文件 /etc/group ,将需要超级用户权力的管理成员加入到 wheel 组中。三个方法: 1. pw groupmod wheel -m <username> 2. pw user mod <username> -g wheel 3. 直接修改 /etc/group 文件,把相应的用户加到 wheell 组就可以: wheel:*:0:root,username 来源: https://www.cnblogs.com/liujingli1986/p/11746160.html

How to debug rc.d scripts in FreeBSD?

狂风中的少年 提交于 2019-12-02 10:39:58
问题 I have a bash script in my /usr/local/etc/rc.d/ that should run python script. I run the bush script with service script_name start and nothing happens at all. How could i debug that rc.d script? How could i know what is going on? 回答1: FreeBSD rc.d system expects /bin/sh scripts. Hence sh debugging techniques apply here. For example printing the statements with set -x and set -v . # cat script.sh #!/bin/sh set -x set -v ... Below is a simple example how to start my_app with the service

Find files in multiple directories taken from list in a file?

瘦欲@ 提交于 2019-12-02 08:33:44
FreeBSD 9.2 RELEASE p2 I have a file fromdirs.txt . In this file is a new line separated directory list like so: /etc /home /home/goods/ I need to first find in all directory's files which have names like "good" or contain string "(NODES_'TASK')" and then copy all these files into the directory /tmp . 2.sh file chmod +x and is 755 fromDirs.txt file chmod +x and is 755 This code give me error IFS=$'\n' read -d '' -r -a dirs < fromDirs.txt find "${dirs[@]}" -type f \( -name '*good*' -o -exec grep -F "(NODES_'TASK')" {} \; \) -exec cp {} /tmp/ \; 2.sh: cannot open fromDirs.txt : No such file or

Enumerate all network interfaces with IPs on FreeBSD

落花浮王杯 提交于 2019-12-02 07:18:50
问题 My application needs to list all network interafaces on a machine and their IPs, IPv4 and IPv6. I can get all interfaces with IPv4 IPs using ioctl(SIOCGIFCONF), but I need the IPv6 IPs, too. On Linux, those can get gotten from /proc/net/if_inet6, but where would I get them on FreeBSD ? 回答1: getifaddrs(3) provides portable way to get network addresses and interface names. 来源: https://stackoverflow.com/questions/7629164/enumerate-all-network-interfaces-with-ips-on-freebsd

Enumerate all network interfaces with IPs on FreeBSD

时间秒杀一切 提交于 2019-12-02 07:02:17
My application needs to list all network interafaces on a machine and their IPs, IPv4 and IPv6. I can get all interfaces with IPv4 IPs using ioctl(SIOCGIFCONF), but I need the IPv6 IPs, too. On Linux, those can get gotten from /proc/net/if_inet6, but where would I get them on FreeBSD ? getifaddrs(3) provides portable way to get network addresses and interface names. 来源: https://stackoverflow.com/questions/7629164/enumerate-all-network-interfaces-with-ips-on-freebsd

Nodejs v0.10.x (freebsd) “X509_STORE_add_cert:cert already in hash table”

我与影子孤独终老i 提交于 2019-12-02 05:44:23
I'm work with async web api and have a problem in nodejs version higer than v0.8.9 $ uname -a FreeBSD home 9.1-STABLE FreeBSD 9.1-STABLE #0: Fri Feb 1 10:38:27 EET 2013 root@home:/usr/obj/usr/src/sys/HOME amd64 $ node -v v0.10.0 $ node ./client.js events.js:72 throw er; // Unhandled 'error' event ^ Error: 34401711104:error:0B07C065:x509 certificate routines:X509_STORE_add_cert:cert already in hash table:../deps/openssl/openssl/crypto/x509/x509_lu.c:357: 34401711104:error:0B07C065:x509 certificate routines:X509_STORE_add_cert:cert already in hash table:../deps/openssl/openssl/crypto/x509/x509

how to disable creating java heap dump after VM crashes?

随声附和 提交于 2019-12-02 00:56:53
问题 JVM runs on FreeBSD with 18Gb memory. creating core file takes about hour, which is very slow, so i need some way to disable it. 回答1: If this is an OS crash dump then use ulimit to set the maximum core size to 0. 回答2: I'm not sure this will work, but if you're using the HotSpot VM, try this in the arguments to the java command: -XX:HeapDumpPath=/dev/null If you want to turn off core dumps altogether, you can use the ulimit approach (make sure to use the -H flag to set the hard limit): ulimit

c, function definition following struct

最后都变了- 提交于 2019-12-01 22:09:51
675 * Check the validity of an ACL for a file. 676 */ 677 int 678 ufs_aclcheck(ap) 679 struct vop_aclcheck_args /* { 680 struct vnode *vp; 681 acl_type_t type; 682 struct acl *aclp; 683 struct ucred *cred; 684 struct thread *td; 685 } */ *ap; 686 { 687 688 if ((ap->a_vp->v_mount->mnt_flag & (MNT_ACLS | MNT_NFS4ACLS)) == 0) 689 return (EOPNOTSUPP); 690 691 if (ap->a_type == ACL_TYPE_NFS4) 692 return (ufs_aclcheck_nfs4(ap)); 693 694 return (ufs_aclcheck_posix1e(ap)); 695 } 696 697 #endif /* !UFS_ACL */ This code comes from Freebsd UFS source. This function looks strange. After function name,