database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
ㆍPostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
PostgreSQL Q&A 6686 게시물 읽기
No. 6686
pgpool 에 대하여.
작성자
안중열(sakura)
작성일
2006-05-17 09:15ⓒ
2006-05-17 09:18ⓜ
조회수
3,920

pgpool이 좋다고 해서 멋도 모르고 그냥 설치는 해 봤는데, 사실 머가 좋은지 잘 모르겠네요.

아래 내용대로인데, 이렇게만 하면 잘 돌아가고 있는 건가요?

pgpool을 왜 사용하는지 관련 글을 읽어 보아도 잘 이해가 안갑니다.

pgpool을 왜 사용하며 아무 곳에나 막 사용해도 전혀 문제가 발생하지 않는지 알고 싶습니다.

pgpool이 좋긴 좋은거죠?

친절한 답변에 미리 감사 드립니다.

 

postgres@www(19)[~]% psql -U postgres -p 9999 -c 'show pool_status' exleague
item | value | description
------------------------------+------------------------------------------------------+------------------------------------------
listen_addresses | localhost | host name(s) or IP address(es) to list en to
port | 9999 | pgpool accepting port number
socket_dir | /tmp | pgpool socket directory
backend_host_name | | master backend host name
backend_port | 5432 | master backend port number
secondary_backend_host_name | | secondary backend host name
secondary_backend_port | 0 | secondary backend port number
num_init_children | 32 | # of children initially pre-forked
child_life_time | 300 | if idle for this seconds, child exits
connection_life_time | 0 | if idle for this seconds, connection c loses
child_max_connections | 0 | if max_connections received, chile exi ts
max_pool | 4 | max # of connection pool per child
logdir | /tmp | logging directory
backend_socket_dir | /tmp | Unix domain socket directory for the
replication_mode | 0 | non 0 if operating in replication modebyte 2135

item | value | description
------------------------------+------------------------------------------------------+------------------------------------------
listen_addresses | localhost | host name(s) or IP address(es) to listen to
port | 9999 | pgpool accepting port number
socket_dir | /tmp | pgpool socket directory
backend_host_name | | master backend host name
backend_port | 5432 | master backend port number
secondary_backend_host_name | | secondary backend host name
secondary_backend_port | 0 | secondary backend port number
num_init_children | 32 | # of children initially pre-forked
child_life_time | 300 | if idle for this seconds, child exits
connection_life_time | 0 | if idle for this seconds, connection closes
child_max_connections | 0 | if max_connections received, chile exits
max_pool | 4 | max # of connection pool per child
logdir | /tmp | logging directory
backend_socket_dir | /tmp | Unix domain socket directory for the PostgreSQL server
replication_mode | 0 | non 0 if operating in replication mode
replication_strict | 1 | non 0 if operating in strict mode
replication_timeout | 5000 | if secondary does not respond in this milli seconds, abort the session
load_balance_mode | 0 | non 0 if operating in load balancing mode
weight_master | 0.500000 | weight of master
weight_secondary | 0.500000 | weight of secondary
replication_stop_on_mismatch | 0 | stop replication mode on fatal error
reset_query_list | ABORT; | queries issued at the end of session
print_timestamp | 1 | if true print time stamp to each log line
master_slave_mode | 0 | if true, operate in master/slave mode
connection_cache | 1 | if true, cache connection pool
health_check_timeout | 20 | health check timeout
health_check_period | 0 | health check period
health_check_user | nobody | health check user
insert_lock | 0 | insert lock
ignore_leading_white_space | 0 | ignore leading white spaces
current_backend_host_name | | current master host name
current_backend_port | 5432 | current master port #
replication_enabled | 0 | non 0 if actually operating in replication mode
master_slave_enabled | 0 | non 0 if actually operating in master/slave
num_reset_queries | 3 | number of queries in reset_query_list
server_status | master( on 5432) up secondary( on 0) unused | server status
(36 rows)

~

이 글에 대한 댓글이 총 3건 있습니다.

postgresql은 프로세스 모델(pre-fork) 특성상 많은 세션(수천개?)을 유지하거나 순간적으로 많은 세션을 버티기에 약간은 취약한 면을 가지고 있습니다.

 

원격의 클라이언트가 잦은 신규 세션을 생성하고 그 사용시간이 짧다. 이런 경우는 대부분 웹인데 이럴 때 pgpool이 유용합니다. pgpool은 초기에 접속 pool을 만들어 놓고 클라이언트가 요청 시 놀고 있는 접속 pool이 있을 때 그것을 클라이언트에게 할당하고 놀고 있는게 없다면 새로운 세션을 맺어서 접속 pool에 넣은 뒤 그것을 클라이언트에게 할당합니다. 새로운 클라이언트가 올 때마다 RESET ALL 명령으로 세션을 초기화 합니다.

 

위와 같은 방식은 새로운 세션을 pgsql이 직접 생성할 때보다 훨씬 적은 비용이 듭니다. 그래서 쓰는 것입니다. ㅎㅎ;

신기배(소타)님이 2006-05-17 13:53에 작성한 댓글입니다.

그리면 PHP로 프로그램을 짤 때 그냥 짜면 되는 건가요.

 

PHP 프로그램에서 pgpool을 특별하게 고려하고 짜야 하는 부분이 있나요?

 

pgpool이 알아서 다 처리 해 주는 건가요?

 

머 개념 파악 잘 안 되니까 저게 질문으로써 맞는지도 잘 모르겠네요. ㅡ.ㅡ;;

 

하튼 친절한 답변에 미리 감사드립니다.

 

참 그리고 기배님 오프라인 모임은 또 언제쯤 있나요?

 

 

안중열(sakura)님이 2006-05-17 14:12에 작성한 댓글입니다.

1%의 상황만 빼고는 pgpool이 알아서 다 해줍니다 ㅎㅎ

웹서버쪽에 pgpool 까시고 로컬에 pgsql에 깔려 있다고 생각하시고 접속하시면 됩니다 :)

오프라인 모임은 저도 모르겠습니다 ㅎㅎ 공지나 자유게시판을 가끔 보시면 될 것 같네요~

신기배(소타)님이 2006-05-17 14:24에 작성한 댓글입니다.
[Top]
No.
제목
작성자
작성일
조회
6689컬럼의 값 변수에 넣기 [3]
권용재
2006-05-17
3025
6688insert 가 안됩니다... [2]
김상택
2006-05-17
2905
6687다국어 홈페이지 제작때문에 질문드립니다. [1]
남성식
2006-05-17
3160
6686pgpool 에 대하여. [3]
안중열
2006-05-17
3920
6685저장 프로시저가 안됩니다. [2]
안중열
2006-05-16
3366
6683postgreSQL7.2.4인스톨시 make에러
김정윤
2006-05-15
2622
6681xlog flush request 3/EC2186D8 is not satisfied 오류
이지석
2006-05-15
2635
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.020초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다