• 카테고리
    • 전체 글

    • 카테고리1
    • 카테고리2
    • 카테고리3
    • 카테고리4
  • 태그
  • 방명록

'분류 전체보기'에 해당되는 글 1249건

  • 2018.06.09 왜 클래스 상속을 하는 걸까?
  • 2018.05.18 MS SQL Connection Timeout 1
  • 2018.04.26 SVN Hook 관련
  • 2018.04.18 악순환의 프로젝트 1
  • 2018.04.13 SVN Sync
  • 2018.04.12 리눅스 백그라운드 실행
  • 2018.04.08 Windows 10에서 HDPI상태 이용 중 확장 모니터 사용할 때 일반 DPI로 쓰는 법
  • 2018.04.06 HTTP Symbol Stores and the Symbol Server Proxy

왜 클래스 상속을 하는 걸까?

카테고리 없음 2018. 6. 9. 22:28

내가 만드는 프로젝트들은 상속에 상속을 자주 하곤 한다.

리펙토링을 하다가 보면, 왜 이렇게 짰지 할 정도로 상속하는 경우가 있다.

되돌려서 생각해보면 상속하게 되는 조건은 다음과 같다.


1. 반복적으로 작성된 코드의 Generaiize - 일반화 구성

  프로그램을 짤 때 제일 중요하게 여기는 부분은 같은 코드 또 안짜기다.

  똑같이 동작하는 코드들이 산재되어 있을 때를 바라보면, 각 클래스들은 무언가 공통적인 부분이 존재한다.

  그런 경우 해당 클래스들의 역할과 내용을 보고 비슷한 애들끼리 다시 묶는다.

  묶어주는 상위 클래스에서 공통적인 코드들을 제공한다.

  물론 static 클래스와 같이 Util 을 제공하는 방법도 있지만,

  나름 멤버 변수등을 통해서 데이터를 유지하면서 공통적인 코드를 실행하는 방법은

  역시 일반화 구성을 통해 상위 클래스로 묶는 방법이다.


2. Polimophism - 다형성 구성

   프로그램을 짜다가 보면, 미묘하게 if ~ else 혹은 switch ~ case 문을 이용하여

   내부 구조를 짜는 경우가 있다. 그런데 가만히 보면 한정적인 부분에 사용되는게 아니라,

   클래스 전반적으로 이 같이 짜는 경우가 있다.

   A 라는 클래스를 만들었는데, Start와 Stop이라는 메소드가 있다.

   그런데 내부 설정에 Type이라는 것을 만들어 Type 별로 Start와 Stop의 동작이 구분되는 경우가 있다.

   이를 구현할 때, Start 안에 switch case로 Stop안에 switch case로 구현하여 제공한다.

   사람마다 관점이 다르긴 한데, 하나의 파일에 하나의 소스 안에 모든 내용이 들어 있어

   관리하기 편하다고 하긴 하는데, 이러면 코드가 엄청 길어지는 모습을 보게 된다.

   필자는 이 경우 차라리 switch case 문으로 갈릴 바에는, 각 switch case에 대응되는 클래스들을 만들고

   그 클래스를 대표하는 상위 클래스로 만든 뒤, abstract 혹은 virtual을 통해 나누어 구현한다.

   switch 기준이 되는 Type이 1, 2, 3, 4 가 있다면, 차라리 c1, c2, c3, c4 라는 클래스를 만들고,

   cbase 라는 클래스를 상속하게 한다. 이렇게 하면, 외부에서는 cbase라는 클래스만 가지고 start, stop을 하면,

   c1으로 new해서 만들면, c1에 대한 start, stop이 불리고, c2를 new해서 만들면 c2에 대한 start, stop만 불리게 된다.


상속이라는게 디버깅하다가 보면 매우 까다롭기도 하고, 왠지 프로그램 전체에 대한 이해가 떨어지면 매우

복잡해 보인다는 문제가 있다. 하지만, 한번 잘 정리가 되면 이 보다 강력한 무기가 있을까?

코드들이 알아서 실행되고, 나뉘고 분리되고, 잘만 짜면 재활용도 가능하게 된다.


아직은 더 배우고 실험해볼 구석도 많긴 하지만 아직은 재미 넘치는 분야인듯 싶다.


728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

MS SQL Connection Timeout

카테고리 없음 2018. 5. 18. 15:41

MS SQL에서 연결 Timeout을 설정할 수 있다.

설정 방법은 SQL ConnectionString을 수정하면 된다.

Data Source=DBServer;Initial Catalog=DBName;User ID=userid;Password=Password;Connect Timeout=30

 

대부분의 경우 위의 Connect Timeout의 값이 설정되지 않으면 기본값으로 15(초)로 설정된다.

그런데, 최소 값은 반드시 4을 초과해야 한다.

만일 1, 2, 3, 4 중의 숫자로 입력하는 경우에는 약 28초 이상을 Timeout으로 갖게 된다.

 

Connection이 되는지 여부를 판단 하기 위해서 Connection을 수행하는데, 이 Timeout을 3이하로 하니까 원하는 결과를 제대로 얻지를 못했다. 그래서 확인해보니 5 보다 작은 숫자를 넣으면 최소값으로 인정받지 못하고 무시되는 형태로 보인다. ( Connection Pool의 상황에 따라 1~2초 차이는 있다. 간혹 3초에서 되기도 하고 4초에서 되기도 한다.)

 

그러므로 최소값으로 설정하고 싶으면 5 이상의 값을 넣어야 된다.

Data Source=DBServer;Initial Catalog=DBName;User ID=userid;Password=Password;Connect Timeout=5

 

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

SVN Hook 관련

기술자료/개발도구 2018. 4. 26. 12:52

Windows 기반에 SVN 서버가 동작할 때, Hook 설정이다.

특히 SVN에서 Commit Action에 Jenkins를 연결할 때 사용하는 방법이다.


1. hook 폴더로 이동.

2. post-commit.bat 파일 작성

3. post-commit.bat 파일 내에 아래와 같이 작성

powershell -Command (New-Object System.Net.WebClient).DownloadString(\"http:///job//build?delay=0sec\");


4. 저장 후 Commit.


만일 인증 토큰을 이용하는 경우에는 URL 부분을 좀 손을 봐야 한다.

powershell -Command (New-Object System.Net.WebClient).DownloadString(\"http://:@/job//build?token=&delay=0sec\");


Linux인 경우에는 CUrl 이라는 명령으로 처리한다.

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

악순환의 프로젝트

잡글/작업로그 2018. 4. 18. 01:21

대략적으로 만들어야 하는 제품을 기준으로 각 구성요소들을 단순 무식하게 계산하여 약 400 M/M 사이즈 프로젝트가 있다고 하자.

1인당 1달 유지비를 1천만원(유지비에는 월급, 행정 처리, 프로젝트 진행 잡비 등등)으로 잡는다고 했을 때, 이 프로젝트는 최소한 40억은 있어야 한다. 그 외에는 별개로 이익 5% 까지 계산하면, 42억 정도 잡힌다.

24개월 기준으로 보면 최소 16명이 있어야 되며, 16명이 24개월 정도 업무를 수행해야 한다. 그런데, 이 M/M에는 함정이 있다. 바로 인력의 개개별의 능력이나 속도 그 외 업무에 대한 이해도 따위는 전혀 없다.

다행히 1~2명은 사업에 대한 이해나, 관련 기술의 이해가 있다고 치다.

문제는 주변인이다. 많게 쳐서 4명이 잘 안다고 해도, 16 명 중 4명 빼면 12명이 있는데, 이 사람들은 이 사업에 대한 이해에서 부터 기술이 전무하다고 하면 아주 진행이 웃기게 된다.


자.. 이것이 한국형 계산법이다.

그런데 한국에서는 저 40억이라고 하면 무척 많은 금액이라고 한다. 그러니 자연스럽게 400 M/M이 걸리는 작업을 마구 후려쳐서 200 M/M으로 계산한다. 즉 40억을 20억으로 줄인다. 상도덕 적으로 40억을 20억으로 줄였으니 전체적인 업무를 줄여야 하는데, 또 그렇지가 않다. 즉 400 M/M짜리를 금액만 200M/M 으로 줄이게 된다.

이와 같은 형태가 되면 어떻게 될까? 그나마 16명으로 어떻게든 유지해보려는 프로젝트는 8명이 해야 되고, 일은 2배가 된다. 인력이 마구 투입된다고 자연스럽게 흘러가지도 않겠지만, 그렇다고 무턱대고 줄이면, 그 나머지 업무를 결국 개개인에게 쏠리게 된다.

이게 야근의 원리다.

결국 전체적인 프로젝트의 퀄리티는 저하될 수 밖에 없고, 개발자는 자연스럽게 허덕이고 야근하고 개발을 하게 된다.


그런데 저 사이즈의 프로젝트가 되게 되면 자연스럽게 개발과는 상관 없는 사업관리 조직이 생긴다. 줄어든 금액에서 또 쪼개 쪼개서 사업관리를 하게 된다. 금액의 절약은 다시 개발자에게 얹어지게 되고, 개발자는 더 많은 일을 할 수 밖에 없는 구조가 계속 진행되게 된다.


이렇게 만들어 놓고 많은 금액을 투입했으니, 넉넉한 기간을 주었으니 잘 만들어 달라고 한다.


?





728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

SVN Sync

기술자료/개발도구 2018. 4. 13. 10:20

SVN 기능 중 Svnsync 라는 기능이 있어, 원격에서 서로 다른 레파지토리를 동기화 시킬 수 있다.
물론 양 측의 리비전을 맞추기 위해서는 저장 대상이 되는 위치는 빈 데이터이여야 한다.

그런데 복사해야할 레파지토리가 오래된 경우 데이터가 매우 커서 한번 Sync를 시도하면 세월아 내월하가 될 수 있다. 더욱이 특정 버전에서 파일크기가 크면, http 기반의 svn 서버 중 일부는 에러를 내고 이야기를 진행하지 못하는 경우도 있다.

이 경우에 처리하는 방법은 다음과 같다.

1. svnadmin dump를 이용해서 원본 데이터를 뜬다.

2. 복제 대상에 원본 데이터를 svnadmin load를 이용해서 붇는다.

3. svnsync init 할 때, --allow-non-empty를 넣어 처리한다.


즉 svnsync 초기화 할 때, --allow-non-empty를 하면된다.


그리고 그 뒤는 sync로 연속.


만일 sync 중 오류가 나면, 해당 revision만 dump를 뜨고 다시 대상에서 붇고 sync를 다시해준다.


중요한 것은 쌍방의 버전이 동일하게 진행되어야 한다.


728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

리눅스 백그라운드 실행

카테고리 없음 2018. 4. 12. 01:11

참조글 : https://www.linuxquestions.org/questions/linux-software-2/rtorrent-how-to-make-it-run-in-the-background-596041


보통 리눅스 작업을 하면 SSH와 같은 원격 접속 쉘을 사용한다.

여러가지 명령들을 사용해서 백그라운드로 실행하는데, 만일 백그라운드로 실행시키지 않았을 때, 해당 SSH를 닫으면 프로그램이 같이 종료된다. 그래서 보통 nohup 과 같은 유틸을 이용해서 백그라운드로 실행을 한다.

그런데 Console 기반의 프로그램 중에는 ANSI를 이용해서 예전 도스 프로그램 처럼 사용자와 In/Out 하는 프로그램들이 있다. 그냥 단순하게 백그라운드 실행을 하게 되면, 해당 화면을 다시 불러오지 못하는 경우가 발생하는데, 이 때 사요하는 유틸이 있었다.

screen "실행할 프로그램"

을 하면 프로그램이 실행이 된다.

여기서 키보드로 Ctrl 과 A를 누른뒤 D를 치면 프로그램을 백그라운드로 돌리고 보통 쉘 창으로 빠져나올 수 있다.

만일 다시 화면으로 돌아가고 싶으면..

screen -r 

을 하면 된다.

Ctrl-A + D를 한 뒤에 SSH를 닫고 나중에 다시 로그린 한 뒤, screen -r을 하면 원래대로 복귀.

리눅스는 역시 무궁 무진 한듯.

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

Windows 10에서 HDPI상태 이용 중 확장 모니터 사용할 때 일반 DPI로 쓰는 법

카테고리 없음 2018. 4. 8. 14:57

Windows 10을 쓰다가 보면, 미묘하게 화면이 틀어져 보일 때가 있다.

특히 고해상도의 작은 노트북에 모니터를 확장해서 연결했을 때가 좀 골때린다. 13인치에 QHD(3200 X 1800) 일 때, 글자가 매우 작아 보이기 때문에, 전체 화면을 200% 정도 확대해서 보곤 한다. 하지만, 모니터는 Full-HD 밖에 지원하지 않기 때문에, 그냥 100%로 맞춰서 사용한다.

그랬을 때 느낄 수 있다. 

아래의 사진은 고해상도의 13인치 노트북에서 찍은 이미지다.

아래의 사진은 24인치 Full-HD 화면에서 찍은 사진이다.

딱 봐도 각 픽셀 사이즈 때문에, 전체적인 그림이 뿌옇게 나타난다. (물론 카메라를 한번 거친거라, 실제 보는 화면 보다는 좀 그럴싸하게 나온건 함정...)노트북에서는 세밀하게 잘 나오는게 이상하게 모니터로만 넘어가면 프로그램이 전체적으로 흐릿드릿 나온다. 또 노트북에서 그럴싸하게 나오는 것들 중에는 아예 크기가 커진 상태로 나오기도 한다.(물론 qHD에 대한 대응이 되는 프로그램들은 잘 나온다.)

한가지 덧붙이자면, WinForm 프로그램(Windows UI 제작)을 하다가 보면, 이쁘게 컨트롤을 배치해서 개발했는데, 실제 일반 환경(확대 150%나 200%하지 않고, 순수하게 100%로 쓰는..)에서 갑자기 화면이 엉망진창으로 나올 때가 있다.

가끔은 이럴때 한숨이 나오게 된다. 특히나 노안이 오고 있는데, 노트북의 세밀 조밀한 화면에서 100%는 쓸 수도 없거니와 보고 있으면 피로하기까지 한다. 그렇다고 노트북을 바꿀 수도 없고..


만약 모니터 확장을 쓰고 있는 것이라면, 그리고 화면 확대 100%를 기준으로 WinForm을 개발하거나, 지금같이 자신이 주로 쓰는 프로그램들을 모니터에서 주로 사용하는데 메뉴나 기타 윈도우 화면이 뿌옇게 나온다면 다음과 같은 대응 방법은 있다.


화면 설정 화면에서 자신의 모니터를 Main으로 바꾸면 된다. 
(보통 고해상도 노트북 화면과 Full-HD의 일반 모니터를 보면 설정화면에서 작은 쪽이 모니터임.)

반드시 이 디스플레이를 주 모니터로 만들기로 체크해주어야 한다.

그리고 로그 오프를 한 뒤 다시 로그인을 하면 된다.


그러면 모든 해상도는 모니터를 기준으로 보여주게 된다.

(당연히 단점이 있다. HDPI를 지원하지 않는 프로그램들은 노트북으로 넘어가면 매우 작은 글자로 보여준다 -_-;;;;)


여튼 상황에 맞게 설정하고 구성하면 개발하는데, 이용하는데 나름 도움이 되는 것 같다.





728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

HTTP Symbol Stores and the Symbol Server Proxy

카테고리 없음 2018. 4. 6. 16:03

원문 : symhttp.doc


HTTP Symbol Stores and the Symbol Server Proxy


Configuring an HTTP Symbol Store

Requirements:  A computer running Windows Server.  Internet Information Services 6.0 is required, so in the examples below we use Windows Server 2003. 


Configuring the Directories

You need to create or select a directory on the computer to act as the symbol store.  For the sake of example, we will call this c:\symstore. We will also presume that the server computer is named \SymMachineName on the network.  Permissions must be set so that users can access the site.  Add the security groups that will need to access the symbol content over the network.  The amount of security to enable will vary from environment to environment.  For some installations, this group will be “Everyone”.

Setup the permissions for the directory

  1. Open the “Windows Explorer”
  2. Expand “My Computer”
  3. Expand the “C” drive
  4. Right-click “c:\symstore” and choose “Sharing and Security”
  5. Check the “Share this folder” button
  6. Click the “Permissions” button
  7. Make sure that the desired security groups have “read” access by adding them under “Group or user names” and checking the appropriate box
  8. Click “OK” to exit “Permissions”
  9. Click “OK” to exit “Symstore Properties”

Normally files are placed in a symbol store with a single tier directory structure in which a single subdirectory exists to store all versions of a certain filename.  Such a tree may look like this 

      c:\symstore\ntdll.dll\

      c:\symstore\ntdll.pdb\

      c:\symstore\kernel32.dll\

      c:\symstore\kernel32.pdb\

However if you are going to store a massive amount of filenames, you may prefer to use the two-tier structure.  To do this, place a file called index2.txt in the root of c:\symstore.  The contents of the file are of no importance.  This would result in a tree that looks like this

      c:\symstore\nt\ntdll.dll\

      c:\symstore\nt\ntdll.pdb\

      c:\symstore\ke\kernel32.dll\

      c:\symstore\ke\kernel32.pdb\

The added layer of directories allows you to use DFS or directory junctions to manage and split up your files.  

Make certain you can view the contents of this directory from other computers on your network.

If you are going to use the Symbol Server Proxy, you can skip the following steps and go to the Configuring IIS section.

  1. Use symstore.exe to populate the contents of c:\symstore.  Instructions for this are available in the debugger documentation.  
  1. Make sure the store works by attempting to debug with it.  Do this by debugging from another computer with a symbol path of srv*\\SymMachineName\symstore.


Configuring IIS

Now you need to configure IIS to serve out the symbols.


Create a Virtual Directory

  1. From “Administrative Tools” open “Internet Information Services (IIS) Manager”.
  2. Expand “Web Sites”
  3. Right-click “Default Web Site” (or other desired site)
  4. Select “New Virtual Directory…”
  5. Click “Next” on the “Welcome” screen.
  6. For the “Alias” enter “Symbols” and click “Next”
  7. For the “Path” enter “c:\SymStore” and click “Next”
  8. Uncheck “Run scripts” (recommended)
  9. Put a check in “Browse” (optional)
  10. Click “Next” then “Finish” to complete the wizard.

Configure MIME Types

  1. Right-click the “Symbols” virtual directory and choose “Properties”
  2. Click the “HTTP Headers” tab.
  3. Click the “MIME Types” button.
  4. Click “New”
  5. For “Extension” enter “*”
  6. For “Mime type” enter “application/octet-stream”
  7. Click “OK” to exit the “MIME Types” dialog.
  8. Click “OK” to exit the “Symbols Properties”

If you want to use Anonymous authentication, then IIS is now ready to serve up files from http://SymMachineName/Symbols.  Test it by restarting the IISAdmin service.  You can do this by running “iisreset.exe” from a command prompt.  Then configure a debugger to get files with the symbol path set to srv**http://SymMachineName/Symbols.  Otherwise, complete the rest of these steps.

It is possible to configure IIS to use “Integrated Windows Authentication” so that clients (windbg.exe for example) can automatically authenticate against IIS without prompting the end-user for credentials. SymSrv.dll on the client, however, does not currently work correctly using Kerberos authentication when connecting to IIS. For this reason it is necessary to remove Kerberos as an option.

Configure the Authentication method

  1. From “Administrative Tools” open “Internet Information Services (IIS) Manager”.
  2. Right-click the “Symbols” virtual directory that was added in the previous steps then choose “Properties”.
  3. Click the “Directory Security” tab.
  4. Under “Authentication and access control” click “Edit”
  5. Ensure that only “Integrated Windows Authentication” is checked.
  6. Make sure “Enable anonymous access” is unchecked
  7. Click “OK” to exit the “Authentication Methods” dialog.
  8. Click “OK” to exit “Symbols Properties”

The following command includes the web site “Identifier”. If you are not using the “Default Web Site” (which is site “1”), you will need to determine the correct identifier by highlighting the “Web Sites” folder and looking at the identifier listed in the right-hand pane for the applicable web site. Replace “1” in the following command with the correct identifier number.

Force NTLM authentication (remove Kerberos authentication)


  1. Open a Command Prompt window.
  2. Change directory to c:\inetpub\AdminScripts
  3. Type the following including the quotes:
    cscript adsutil.vbs set W3SVC/1/root/Symbols/NtAuthenticationProviders "NTLM"


IIS is now ready to serve up files from http://SymMachineName/Symbols.  Test it out by restarting the IISAdmin service and configuring a debugger to get files with the symbol path set to srv**http://SymMachineName/Symbols.


Configuring an HTTP Symbol Server Proxy

You can configure your HTTP-based symbol store to act as a proxy between client computers and other symbol stores.  The implementation is through an ISAPI filter called SymProxy.dll.  The SymProxy server can be used as a gateway computer to the Internet or other sources within your company network. 

The Symbol Server Proxy can be a valuable setup for many situations. The following are some examples. 

  • You are debugging many systems within a lab environment in which the computers are not attached to the company network, but the symbols are stored in the network and must be accessed using Integrated Windows Authentication. 

  • Your corporate computing environment includes a firewall that prevents access to the internet from computers that are debugging and you need to get symbols from an internet web site such as http://msdl.microsoft.com/download/symbols. 

  • You wish to present a single symbol path for all users in your company so that they don’t need to be aware of where symbols come from and so that you can add new symbol stores without user-intervention. 

  • You have a remote site that is physically far from the rest of your company resources and network access is slow.  This system can be used to acquire symbols and cache them to the remote site. 

Installation of SymProxy requires the manual location of files, a way to authenticate your SymProxy to remote symbol stores, and reconfiguration of IIS.  You are also required to go through the “Configuring an HTTP Symbol Store” section of this document.

 

Installing the Filter 

Begin by installing the filter on the server.  Copy symproxy.dll and symsrv.dll to %WINDIR%\system32\inetsrv.   

Create a file called %WINDIR%\system32\inetsrv\symsrv.yes.  The contents of this file are of no consequence.  This prevents problems accessing the Microsoft Symbol Store at http://msdl.microsoft.com/downloads/symbols.

 

Configuring the Registry 

SymProxy stores its settings in the following registry key 

HKLM/Software/Microsoft/Symbol Server Proxy 

From this location, SymProxy learns what logging level to use as well the location from which to grab symbols for storage in the web site. 

You can create this key by running the symproxy.reg tool.  This tool is provided with the product.  Type “symproxy.reg” on the command line or simply double-click it from “Windows Explorer”.


Web Directories 

Within this key, a subkey named “Web Directories” exists.  It is in this key that the source paths from obtaining symbols is stored.  You need to create a separate key below here that matches the name of every virtual directory you generated in IIS to run a symbol store from.  For example, if you named this directory “symbols”, then create a registry key under “Web Directories” with that name. 

Then in each of the keys you have created, create a new “String Value” (REG_SZ) or “Expandable String Value” (REG_EXPAND_SZ) called “SymbolPath”.  Edit the contents of this value to contain all the symbol stores that will be used to feed the SymProxy symbol store.  If there is more than one, then separate them with semicolons.  A maximum of 10 stores is supported.  HTTP paths need to include the “http://” prefix and UNC paths need to include the “\\” prefix.

For example:

                \\symbols\symbols;http://msdl.microsoft.com/download/symbols

In this example, symbols will first be looked for in \\symbols\symbols.  If the files are not found there, then the Microsoft Symbol Store will be used. 

If the “SymbolPath” value is not properly set, the filter will not know where to obtain symbols from and it will not work.

It is also possible to define a global source for all symbol files by generating a “SymbolPath” value directly in the “Web Directories” key.  However this is highly discouraged, because it will cause malformed symbol requests from debugging clients to generate bogus directories and files in the root of your web site.


Logging

SymProxy reports its activity to the Application Event Viewer.  The level of reporting is set by the value stored in “LogLevel”.  This is a REG_DWORD located in the “Symbol Server Proxy” key.  Normally it is set to zero.  You can change this to any of the following values

0 - quiet 

1 - error

2 - success

3 – info

4 – warning

5 - debug

If you are having trouble moving files into the symbol store, you can adjust these values to see what is happening.  Set the “LogLevel” to 5 and all activity will be put in the Event Viewer.  If you want to see which files come from where and be able to examine the initialization, set the “LogLevel” to 3.

In order to complete the configuration of the logging, you need to register SymProxy with the Application Event Viewer.  Do this by adding the following key to the registry…

                HKLM\SYSTEM\CurrentControlSet\Services\EventLog\Application\SymProxy

Within this key, create a new “Expandable String Value” (REG_EXPAND_SZ) called “EventMessageFile”.  Set the contents of this to read as so…

“%WINDIR%\system32\inetsrv\symproxy.dll”. 

This will add symproxy.dll as a message source to the registry and cause application logging to work. 


HTTP Proxies

You may also need to set up HTTP proxy settings so that the service can access outside network resources.  You can do this using the proxycfg program.  Type “proxycfg.exe -?” for instructions.  The default behavior of SymProxy is to use whatever HTTP proxy is designated by this program.  If no HTTP proxy is configured, then SymProxy will use a dummy proxy.  The reason for this is to allow for access to secure HTTP sites within your intranet.  As a side effect, this prevents SymProxy from working with direct connections to the external internet.  You can disable this through the registry.  Create a REG_DWORD called “NoInternetProxy” located in the “Symbol Server Proxy” key.  If this value is set to 1 and there is no HTTP proxy indicated by proxycfg.exe, then SymProxy will operate with a direct connection to the internet.


Choosing Network Security Credentials

The web service needs to run from a security context that has the appropriate privileges to access the symbol stores that you intend to grab symbols from.  If you will be sourcing from an external web store such as http://msdl.microsoft.com/download/symbols, then this account will need to be able to access the web from outside any firewalls.  If you will be picking up any files from other computers on your network, then the account will need to have appropriate privileges to read files from those shares.  Some options available are to set the SymProxy to authenticate as the “Network Service” account, or to create a user account that is managed within Active Directory along with other user accounts, such as your own.

Authenticate as “Network Service”

The “Network Service” account is built-in to Windows, so there is no extra step of creating a new account.  For this example, we will presume the machine where the Symbol Proxy is being configured is SymMachineName on a domain called corp.

Note that external symbol stores (or internet proxy) will have to be configured to allow this machine’s “Network Service” account (Machine Account) to authenticate successfully.   There are 2 general methods of ensuring access:

  1. Allow access to the “Authenticated Users” group on the external store (or internet proxy).
  2. Allow access to the Machine Account, “corp\SymMachineName$”  This option is more secure because it limits access to just the Symbol Proxy machine’s “Network Service” account.


Authenticate as a Domain User

For this example, we will presume the user account is named SymProxyUser on a domain called corp. 

It is good practice that this account should only have privileges necessary to read files and copy them to c:\symstore.  This is to prevent the system from being corrupted in some manner by clients accessing your HTTP store.  

Add user account to the IIS_WPG group

  1. From “Administrative Tools” open “Computer Management”
  2. Expand “Local Users and Groups”
  3. Click “Groups”
  4. Double-click “IIS_WPG” in the right pane
  5. Click the “Add” button
  6. Enter “corp\SymProxyUser” in the pane labeled “Enter the object name to select”
  7. Click “OK” to exit “Select Users, Computers, or Groups”
  8. Click “OK” to exit “IIS_WPG Properties”
  9. Close the “Computer Management” console

Note that external symbol stores (or internet proxy) will have to be configured to allow this user to authenticate successfully.  


Configuring IIS for SymProxy

IIS needs to be configured to use the symproxy.dll as an ISAPI filter.  Furthermore, permissions need to be set so that IIS can grab symbols.

Configure the Application Pool

  1. From “Administrative Tools” open “Internet Information Services (IIS) Manager”
  2. Right-click “Application Pools” and choose “New” à “Application Pool”
  3. For the “Application ID” enter “SymSrv Pool”
  4. Click “OK” to exit “Add New Application Pool”
  5. Right-click the “SymSrv Pool” application pool and choose “Properties”
  6. Click the “Identity” tab.
    1. If you chose to authenticate as “Network Service”

                                                               i.      Choose “Predefined” for the “Application pool Identity”

                                                             ii.      Select “Network Service”

    1. If you chose to authenticate as a Domain User

                                                               i.      Choose “Configurable” for the “Application pool identity”

                                                             ii.      Enter the credentials of the account that has permissions to access the remote symbol server store(s) (“corp\SymProxyUser”) , then click “OK”.

  1. Click “OK” to exit “SymSrv Pool Properties” 


Set up the Virtual Directory

  1. Expand “Web Sites”
  2.  Expand “Default Web Site”
  3. Right-click the “Symbols” virtual directory and choose “Properties”
  4. While on the “Virtual Directory” tab click the “Create” button.
  5. For the “Application Pool” drop-down choose “SymSrv” Pool”
  6. Click “OK” to exit the “Symbols Properties”.


Configure the ISAPI Filter

  1. Right-click the “Default Web Site” and choose “Properties” (or properties of applicable web site).
  2. Click the “ISAPI Filters” tab.
  3. Click “Add”
  4. For “Filter Name” type “SymProxy” or some other meaningful name.
  5. For “Executable” enter “c:\windows\system32\inetsrv\symproxy.dll”
  6. Click “OK” to exit the “Filter Properties” dialog.
  7. Click “OK” to exit the “Default Web Site Properties” 


Exclusions

In some environments, you may find yourself debugging systems for which there is a large quantity of modules loaded for which you cannot obtain symbols.  This is often the case if you have code that is called by another third-party vendor.  This can result in a lot of failed attempts to grab symbols.  This can be time-consuming and clog up network resources.  To alleviate this situation, you can use an Exclusion List to specify symbols that you don’t want to search for.  This feature exists in the client debugger. 

Alternately, you can configure the SymProxy filter to utilize its own the Exclusion List and prevent such network activity where it is most likely to take up resources.

The list is made up of the names of the files for which you want to prevent processing.  The file names can contain wildcards.  For example

      dbghelp.pdb

      symsrv.*

      mso*

The list can be implemented in two ways.  The first is an ini file, %WINDIR%\system32\inetsrv\symsrv.ini.  A section called “exclusions” should contain the list.

      [exclusions]

      dbghelp.pdb

      symsrv.*

      mso*

Alternately you can store the exclusions in the registry.  Create a key called HKLM\ Software\Microsoft\Symbol Server\Exclusions.  Store the file name list as string values (REG_SZ) within this key.  The name of the string value acts as the file name to exclude.  The contents of the string value can be used as a comment describing why the file is being excluded.

SymProxy reads from the Exclusion List every half-hour so that you don’t need to restart the web service to see changes take effect.  If the ini file exists, it will be used.  Otherwise the registry is checked.  SymProxy does not support the use of both symsrv.ini and the registry.  Simply add files to the list in the registry or ini file and wait a short period for the exclusions to be used.


Timeouts

If one of the symbol server stores that Symbol Server is configured to grab files from is down or otherwise unavailable, the result can be long waits from the client for every file request.  You can avoid most of these waits by setting up Symbol Server to stop trying to access the store in question.  When this feature is engaged, Symbol Server will stop trying to use the store for a set period of time after it experiences a specified number timeouts from the same store in another set period of time.  All three of these values can be controlled by an ini file or from the registry.

  • trigger indicates the amount of minutes to look for the indicated amount of timeouts.
  • count is the amount of timeouts to look for within the trigger period.
  • blackout is the amount of minutes to disable the store once the threshold is reached.

In %WINDIR%\system32\inetsrv\symsrv.ini, create a section called “timeouts” and add the following values…

      [timeouts]

      trigger=10

      count=5

      blackout=15

You can set the “trigger” and blackout values to any amount of minutes you think is appropriate.  In this recommended example configuration, the store access will be turned off if 5 timeouts are experienced in a 10 minute period.  At the completion of a 15 minute blackout, the store will be reactivated. 

You can also use the registry in the same way.  Create a key called HKLM\ Software\Microsoft\Symbol Server\Timeouts.  Then add a REG_DWORD values called trigger, count, and blackout within this key.  Set the values as described previously.

Whether using the registry or an ini file, if the any of the trigger, count, or blackout values are set to 0 or if all such keys and values do not exist, this functionality will be disabled. 

This feature of Symbol Servers is currently only available when running as a service.  This means that the only practical application of this feature is when it is called from SymProxy.


Status

It is possible to see where symproxy is configured to acquire symbols from by using any browser software.  Just bring up status to get the information.  So if the symbols web site is http://server/symbols, then go to http://server/symbols/status.  You can also use this to cause symproxy to re-read its configuration information after making a change to the registry.  This is handy for changing the paths without having to restart the IIS service.


File Pointers

A UNC symbol store supports placing the actual files to be served in a separate location, with the client code learning of their whereabouts through file pointers.  These pointers are generated in the symbol store using symstore.exe with the “/p” option.  This scenario is supported with vanilla HTTP-based symbol stores only if the file pointers point to a UNC location that is directly accessible by the client.  When SymProxy is loaded into the web server, this functionality is enhanced.  The client no longer needs to be able to directly access the target files, because SymProxy will serve them through the HTTP interface.  This feature runs exclusive from the main proxy component discussed earlier and requires no preparation of the “Symbol Server Proxy” key in the registry.

Since this feature is automatically applied, an option exists to turn it off.  This is in case you want to use the proxy for serving some files and regular file pointer implementation for others.  To do this, create a REG_DWORD called NoFilePointerHandler in HKLM\Software\Microsoft\Symbol Server.  Set this value to 1 (or anything other than 0) to turn off the internal file pointer handler in symproxy. 


Double vs. Single File Caching

Normally, SymProxy caches the files it acquires into the directory designated within IIS as the virtual root for the associated web site.  Then IIS makes the file available to the client debugger.  Since the debugger cannot open a file directly from HTTP, it copies the file to a local cache, specified by the symbol path.

                srv*c:\localcache*http://server/symbols

In this example, the client debugger copies the file to c:\localcache.  In a situation such as this, the file is copied twice – once by SymProxy to the virtual root of the web site, and again by the debugger to its local cache.

It is possible to avoid the second copy operation and speed up processing.  To do this, you first need to share the virtual root of the web site as a UNC path that can be accessed by the debuggers.  For sake of example, we will call this \\server\symbols.

Then, remove the IIS configuration for mime types…

  1. From “Administrative Tools” open “Internet Information Services (IIS) Manager”.
  2. Expand “Web Sites”
  3. Right-click “Default Web Site” (or other desired site)
  4. Right-click the “Symbols” virtual directory and choose “Properties”
  5. Click the “HTTP Headers” tab.
  6. Click the “MIME Types” button.
  7. Select all types in the list box labeled “Registered Mime Types”.
  8. Click the “Remove” button.
  9. Click “OK” to exit the “MIME Types” dialog.
  10. Click “OK” to exit the “Symbols Properties”


 This will cause IIS to return “file not found” to the debugging client for all transactions on the web site.  However it will not prevent SymProxy from populating the virtual root with the file.

Lastly configure the debugger clients to look for symbols first in the HTTP store, and then in the share that maps to the virtual root of the store.

                srv**http://server/symbols;srv*\\server\symbols


In the above example, the first element of the symbol path (srv**http://server/symbols) says to get files from the HTTP store and copy them to the default symbol store as a local cache.  The specified cache is of no importance because no file will ever be received from the HTTP store.  After this failure, it will attempt to grab the file from the actual location of the virtual root of the store (srv*\\server\symbols).  This attempt should succeed because the file was copied to that location as a side effect of the previous path processing.


Try it out

The system should now be ready to acquire and serve up files.  Test it out by restarting the IISAdmin service and configuring a debugger to get files with the symbol path set to srv**http://server/symbols.

728x90
저작자표시 (새창열림)
블로그 이미지

하인도1

[하인드/하인도/인도짱 의 홈페이지] 저만의 공간입니다. 다양한 소재들을 나열하는 아주 단순 무식한 홈페이지 입니다. 다양한 문서 자료도 있겠지만, 저의 푸념들도 있답니다.

  • «
  • 1
  • ···
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • ···
  • 157
  • »
250x250

블로그 내에 소스 코드 삽입 이사온 기념 스킨도... RSS 전문 기능 비활성화 관련. 스킨 바꾸어 보았습니다. 서버 파일 정리 좀 했습니다.

«   2025/12   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

인터파크 Tutorial 비스킷 Buscuit 블로그 매뉴얼 MOSS 2007 좀 수 Azure Visual Studio 오류 친구 Google Apps Engine me2dayzm me2sms me2photo 것 e-book 개발환경 twi2me SharePoint 2010 windows 불만 java 지름신 moss 협업 WSS

  • Total :
  • Today :
  • Yesterday :

Copyright © 2015-2025 Socialdev. All Rights Reserved.

Copyright © 2015-2025 Socialdev. All Rights Reserved.

티스토리툴바