'보미아빠, 석이'에 해당되는 글 529건
- 2015.03.18 봄양 자전거 후보
- 2015.03.17 wait 생각날때마다.
- 2015.02.18 2012 express sp2
- 2015.02.15 가민으로 코스짜기
- 2015.02.12 가민 1000 한시간 안에 Google Korea 지도넣기
- 2015.02.08 windows service application 만들기와 자동 install 버전 만들기
- 2015.02.01 link
- 2015.01.17 SQLStress version 0.1 1
- 2015.01.14 treesize free 무설치버전
- 2015.01.06 samsung kies 설치에러
wait 생각날때마다.
wait type 과 의미를 천천히 정리해보자
생각날 때 추가해 보도록 하지요....쉽게~ 대충 정리하고 이쁘게 나중에 공식문서로 만들어보죠~
일단은 마구 적습니다. 그리고 나서 하나하나 시나리오를 만들어서 테스트하고 책으로 출간 sqltag book 3?
절대적으로 신뢰하지 말고 테스트 해봐야 합니다. 틀린게 보이면 언제든지 말해주세요~
io_completion 은 tempdb 를 사용해 sort spill 을 하거나, 어떤 동기 i/o 오퍼레이션을 할때 나타난다. 이걸 mdf ldf 를 잘 살펴보고 io 를 분산하라고 하면 안된다. io_completion 은 직접적인 data page 의 io 대기가 아니다. tempdb 를 잘 보살펴야 한다. sort 를 제거하던지....
async_io_completion backup alter database create database 등을 할 때 나타날 수 있다.
sleep_task 는 hash match 연산을 하면 일어날 수 있다. 역시 tempdb 를 잘 보살펴야 한다. hash_match 를 안하게 하던지
async_network_io 는 select 하는 데이터양이 많아 네트워크로 보내는 데이터가 많으면 일어날 수 있다. 데이터를 줄이던지 fetch count 를 적절히 크게 하던지 등등
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
SqlNetTest sqlNetTest = new SqlNetTest();
for (int i = 0; i < 5; i++)
{
sqlNetTest.execute();
}
}
}
class SqlNetTest
{
private List<NetTestResult> netTestResults = new List<NetTestResult>();
private string ConnectionString
{
get
{
return "Data Source=xxxxxx;Initial Catalog=xxxxx;User ID=xxxxxx;Password =xxxxx";
}
}
public void execute()
{
this.netTestResults = usp_netTest(this.ConnectionString);
foreach (var a in netTestResults)
{
Console.WriteLine("name : {0}, type {1}", a.name, a.type);
}
}
private List<NetTestResult> usp_netTest (string ConnectionString)
{
List<NetTestResult> netTestResults = new List<NetTestResult>();
using (SqlConnection conn = new SqlConnection(ConnectionString))
{
conn.Open();
using (SqlCommand cmd = conn.CreateCommand())
{
cmd.CommandText = "dbo.usp_netTest";
cmd.CommandType = CommandType.StoredProcedure;
SqlDataReader read = cmd.ExecuteReader();
while (read.Read())
{
NetTestResult netTestResult = new NetTestResult();
netTestResult.name = read.IsDBNull(read.GetOrdinal("name")) ? "" : read.GetString(read.GetOrdinal("name"));
netTestResult.type = read.IsDBNull(read.GetOrdinal("type")) ? "" : read.GetString(read.GetOrdinal("type"));
netTestResults.Add(netTestResult);
Thread.Sleep(100);
}
read.Close();
}
conn.Close();
}
return netTestResults;
}
}
public class NetTestResult
{
public string name { get; set; }
public string type { get; set; }
}
}
oledb 는 연결된 서버나 자신의 sql server 외 연결된 데이터 억세스에서 대기가 일어난 경우이다.
latch_xx 는 비 데이터페이지의 대기이다. 메모리 동기화를 위해서 일어나는 대기이다 디스크가 빠르던 느리던 상관없다.
sos_schedulder_yield cpu 를 많이 쓰는 경우 일어나는 대기이다. 사용할 quantum time 을 다 쓰고 scheduler 를 양보할 때 나타난다. 4ms 동안 하나의 logical core 를 다 쓰고 다시 resource wait 나 runnable queue 에 들어가는 경우이다. 수 us 쓰고 나갈꺼라고 생각했는데 비선점점형 스케줄링에 의한 강제양보까지 기다린다니 얼마나 많이 cpu 를 쓰겠는가?
resource_semaphore memory grant 에 시간이 걸릴때 이다. 메모리를 늘이거나 메모리를 안쓰게 하거나 메모리를 적게쓰게 튜닝한다. 아무리 메모리가 많아도 oltp 는 어쩌고 저쩌고 나도 안다.......쿨럭~ 쉽게 가자고~
cmemthread 역시 메모리 동기화 문제이다. enter critical section exit critical section 으로 동기화 하는데 오랜 시간이 걸린 경우이다. 생각해보라 1) 특정 메모리 영역이 가득차 있고 추가 메모리를 할당할수 없는 상태에서 메모리를 달라고 하면 enter critical section 한 뒤에 메모리를 받을수가 없다. 아니면 2) numa node 당 메모리를 줄 수 있는 부분이 있는데 이 부분을 core 단위로 분리하면 실제 메모리가 있는 상황에서는 동기화 문제를 효과적으로 분배할 수 있다. tempdb iam gam sgam 대기 걸리면 tempdb 쪼개잖아~ 그럼 확 빨라지는 경우를 생각해 봐라
writelog 로그 플러시 시간이 오래 걸리는 경우이다. 이건 disk sub-system 이 병목이 되는지 살펴보고 더 많은 로그를 써야 한다면 데이터베이스를 쪼개서 더 많은 ldf 파일을 쓰도록 하는 방법이 있다. 또는 안 쓰는 인덱스를 지워 트랜젝션 로그를 적게 쓰도록 하면 된다. 혹은 버전을 올린다. 버전을 올리면 더 빨라진다. 무슨버전에서 바뀌었는지 기억이 나지 않는다......아는사람 알려주기~
cxpacket 병렬처리에서 thread 별로 일할 데이터를 골고부 배분하지 못하면 이 대기가 크게 나타날 수 있다. 왜냐하면 코디네이터 하나는 전체 처리기간동안 cxpacket 대기를 찍을것이고, 일꾼들 중 1개 thread 에 100개의 일량을 받고 나머지 3개 thread 에 일량을 받지 못하거나 너무 적게 받았다면 이 대기는 무척 커질수 있다. 코디네이터 100 + 일꾼 3 * 100(99) 의 대기가 발생한다. (한넘을 열심히 일하잖아 ^^) 그런데, 4개의 thread 에 동일하게 일량이 배분되면 코디네이터 25 의 대기가 발생한다. 일량 배분 알고리즘과 강제 일량 분배에 대해서는 쿼리테크닉이 필요하다.
threadpool 이것은 worker thread 가 소진되어 thread 를 할당받지 못할경우 발생할 수 있다. max worker thread 를 늘여주거나 병렬처리나 lock 을 줄여 thread가 소진되지 않도록 쿼리를 잘 짠다.
pageiolatch_xx 이건 뭐 디스크 열라게 긁어서 그런거다 쿼리를 효율적으로 바꾸어 읽어야 할 데이터만 읽도록 하던지 메모리를 늘여 디스크에서 안 읽게 하던지 디스크를 빠르게 하던지 선택의 폭은 다양하다
checkpoint_queue 체크포인트 끝부터 체크포인트 시작까지 대기시간 (체크포인트 하고있는 시간은 빠진다) 하루종일 체크포인트 치고 있으면 이 시간이 짧을것이다. (안부장님)
logmgr_queue 이것은 i/o 병목이라고 보지 않는다. 그냥 다른넘들도 잘 트랜젝션 로그 쓰기를 시도하고 있구나 정도의 참고수치가 될 듯 하다. 다른 워커가 로그 블럭이 비워지기를 기다리고 있는것을 나타내며 기다리는 아이 몇 넘 * 시간 으로 증가한다.
Used by the background worker "Log Writer" to wait on a queue for requests to flush log blocks to the transaction log. This is an "optional" wait type see Important Notes section in blog You should be able to safely ignore this wait type unless you believe a problem exists in processing log blocks to flush to the transaction log.
This wait type is not a wait indicating I/O bottlenecks. It is only for waiting for other workers to request log block flushes. Note that on SQL Server 2005 this wait type will not show up in sys.dm_exec_requests because the Log Writer task does not show up there.
logbuffer 이게 i/o 병목이다. 워커쓰레드가 트랜젝션 로그블럭을 로그버퍼에 쓰려고 하는데 로그버퍼가 없어 대기하는 상황이다. 다른 워커쓰레드가 writelog 가 블럭을 잡고 있기 때문이다.
Used to indicate a worker thread is waiting for a log buffer to write log blocks for a transaction
This is typically a symptom of I/O bottlenecks because other workers waiting on WRITELOG will hold on to log blocks. Look for WRITERLOG waiters and if found the overall problem is I/O bottleneck on the storage system associated with the transaction log
똑똑한 아저씨들 링크
http://blogs.msdn.com/b/psssql/archive/2009/11/03/the-sql-server-wait-type-repository.aspx
다른거 유용한거 있으면 댓글 받아요~ 같이 만들어 보아요~
2012 express sp2
http://www.microsoft.com/ko-kr/download/details.aspx?id=43351
http://blog.naver.com/nicepants/220162345623
1. http://gpsnote.net/HammerBoard/View.aspx?article=139&alias=download&page=1&keyword=&masterfile=&theme=
에서 프로그램을 다운 받는다.
2. 네이버 자전거 길찾기로 대충의 라우트 설정 (위성지도 보면서 고려!)
3. gpsnote 설치하고 열심히 점 찍기
4. 좌측 상단의 그래프 아이콘 눌러서 고도정도 다운로드 받기
5. 파일저장 -> garmin\newfiles 에 넣으면 된다.
*. http://bikeroutetoaster.com/BRTWebUI
가민 1000 한시간 안에 Google Korea 지도넣기
준비물 : 마이크로 SD카드 16GB, 마이크로 SD카드 리더, 컴퓨터
시작
1.
http://whiter.brinkster.net/en/Versions.shtml 에 가서 Edge 1000 2.70 버전의 순정 펌웨어를 다운 받는다. (테스트는 안되었다고 되어있음)
2. patcher 3.30 를 설치한다. (같은 게시글 위에 링크 있음)
3. 순정 펌웨어를 patcher 로 패치 한다.
4. 패치된 펌웨어 이름을 변경해서 복사해 넣는다.
가민 1000을 usb 로 붙이고 Garmin 폴더에 GUPDATE.gcd 로 복사해 넣고 리부팅 하면 끝이다.
5. 벽돌되면 알아서 잘 해결하세요 전 잘 되더라구요
6. 누군가 만들어 놓은 JNX Google 지도를 토렌트를 이용해 받는다. 난 귀찮으니깐 http://goo.gl/H9Bhk
7. D:\Garmin\BirdsEye <--- 에 JNX 지도파일을 모두 복사해 넣는다.
8. 가민에 SD 카드 넣고 리부팅 후 23초 기다림
9. Ride.... 우리 친구 할까요? 가민 뭐 친구가 된다는데
아래 원본 주소를 참고하시면 그림과 함께 자세한 설명이 있습니다.
선배님들 감사합니다. 쿨럭~
http://barnabas.kr/index.php/archives/172504
http://whiter.brinkster.net/en/Versions.shtml
http://blog.naver.com/pinmanix/220096590030
google 지도 만세~
windows service application 만들기와 자동 install 버전 만들기
1. service 프로그램으로 만들기전 console application 으로 완전체를 만든다
2. 서비스 디버깅
1) service 로 돌때 디버깅이 가능하게 하려면 몇몇 절차를 거쳐야 한다.
- services.msc 에서 설치된 서비스의 로그온에 사용자와 상호작용을 체크
- 디버그 > 모듈에서 지정된 pdb 를 로딩하고 ms public 심벌을 모두 로딩한다.
- visual studio 에서 프로세스에 연결한다.
- 적당한 break point 를 걸고 작업
2) service app 은 f11 로 일반프로그램처럼 디버깅이 자연스럽게 되지 않으므로
시작 포인트를 2개 만들어 console 과 windows service 로 둘 다 사용할 수 있도록 한다.
1) Service1.cs 에 method 를 추가한다.
시작포인트를 2개 만들기 위해 아래와 같이 수정한다.
파란 부분을 주석을 제거하고 사용하면 된다.
public partial class Service1 : ServiceBase
{
public Service1()
{
InitializeComponent();
}
protected override void OnStart(string[] args)
{
CXeMover cXeMover = new CXeMover();
Thread thread = new Thread(() => cXeMover.start());
thread.Start(); // 지속적인 while 프로그램은 thread 로 시작하지 않으면 service 시작이 안된다.
}
protected override void OnStop()
{
}
////추가된 method
//internal void TestStartupAndStop()
//{
// string[] args = { "" };
// this.OnStart(args);
// Console.ReadLine();
// this.OnStop();
//}
}
2) Program.cs 의 main 을 변경한다.
역시 파란색 부분을 주석제거하고 사용하면된다.
static class Program
{
/// <summary>
/// 해당 응용 프로그램의 주 진입점입니다.
/// </summary>
///
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service1()
};
ServiceBase.Run(ServicesToRun);
}
//static void Main()
//{
// if (Environment.UserInteractive)
// {
// Service1 service1 = new Service1();
// service1.TestStartupAndStop();
// }
// else
// {
// ServiceBase[] ServicesToRun;
// ServicesToRun = new ServiceBase[] { new Service1() };
// ServiceBase.Run(ServicesToRun);
// }
//}
}
3) 솔루션의 속성 변경
출력형식에서 Windows 응용 프로그램을 console 로 시작할 경우 콘솔 응용프로그램으로 변경 한다.
3. root 폴더의 인식이 Console 과 다르므로 다음을 참고한다.
테스트를 위해서 아래와 같이 파일 생성코드를 간단히 작성하는것이 도움이 된다.
1) Service1.cs 의 OnStart 와 OnStop method 를 수정한다.
protected override void OnStart(string[] args)
{
System.IO.File.Create(AppDomain.CurrentDomain.BaseDirectory + "Onstart.txt");
}
protected override void OnStop()
{
System.IO.File.Create(AppDomain.CurrentDomain.BaseDirectory + "OnStop.txt");
}
2) 빌드에서 debug 일때만 동작하는 코드를 추가하기 위해서는 아래와 같은 속성을 사용한다.
#if DEBUG
Service1 myService = new Service1();
myService.OnDebug();
System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
#else
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service1()
};
ServiceBase.Run(ServicesToRun);
#endif
3) 서비스 인스톨 후 바로 시작하게 할려면 다음과 같은 코드를 이용한다.
Service1.cs 에서 이벤트 추가 후 (번개표시를 눌러 인스톨 후 작업할 것을 작성한다.)
private void serviceInstaller1_AfterInstall(object sender, InstallEventArgs e)
{
new ServiceController(serviceInstaller1.ServiceName).Start();
}
3. 수동 인스톨
x64의 경우 관리자모드로 x64 네이티브 도구 명령 프로프트를 이용해서
D:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\Shortcuts
등록 installutil xEventsMover.exe
삭제 installutil /u xEventsMover.exe
4. 자동인스톨
MSI 인스톨러를 이용해 작업할 경우
인스톨러에 기본이 32비트 installutil 을 사용하도록 되어 있다.
프로젝트의 속성중 TargetPlatform 을 x64 로 바꾸어 줘야지만 컴파일이 된다. 컴파일이 되고난 이후라도 설치시 에러가 난다. badImage ....1001 이라고 발생한다. 이때는 Orac 를 이용해서 프로그램 데이터베이스를 직접 수정해 주어야 한다.
I have finally figured this out - it has NOTHING to do with architecture, references or any other nonsense and everything to do with the installer itself. As this article explains - http://blogs.msdn.com/b/heaths/archive/2006/02/01/64-bit-managed-custom-actions-with-visual-studio.aspx - the Visual Studio Installer, by default, uses a 32 bit DLL and that is what causes the failures.
To overcome this problem, simply follow these steps:
1.Make sure that you go into the Properties => Build tab for every project and set the Target Platform to x64
2.Click on the name of your Installation project and then Properties and ensure that the Target Platform is x64
3.Build your solution - if the solution does not compile, right click and Unload Project and then Load Porject for those projects whose references fail.
4.Go to http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=3138 and download and install the 7.0 INstaller SDK
5.Go into the C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin folder and install Orca by double-clicking on the Orca.Msi file
6.Run Orca and open your project's MSI folder
7.Select the Binary table
8.Double click the cell [Binary Data] for the record InstallUtil
9.Make sure "Read binary from filename" is selected
10.Click the Browse button Browse to C:\Windows\Microsoft.NET\Framework64\v4.0.30319
11.Select InstallUtilLib.dll
12.Click the Open button and then the OK button
Orca.MSI 는 windwos sdk 를 깔아야지만 생기나 편의성을 위해서 다운받을수 있게 업로드 해둔다.
만약 지속적으로 x64만 컴파일 해야 한다면 x86의 installUtil 이미지를 x64의 이미지로 교체하면 된다.
아 ~ 돌아버릴뻔 했어유~
1. C:\Windows\Microsoft.NET\Framework\v4.0.30319 의 InstallUtil.exe, InstallUtil.exe.conifg, installUtilLib.exe 를 백업한다. (사용자 권한이 Trustedinstaller 로 되어 있으니 이를 Administrator 로 변경한 후 파일 삭제)
1.1 각 파일의 속성을 클릭해 그룹 또는 사용자 이름에 administrator 를 선택하고 고급 소유자를
1.2 administrator 로 변경한다.
1.3 각 파일에 administrator 에 full 권한을 준다.
1.4 파일삭제
2. C:\Windows\Microsoft.NET\Framework64\v4.0.30319 의 3파일을 x86 위치로 복사해 넣는다.
3. 파일권한 변경은 구글에서 찾아보세요~
6. 전체적인 절차는 웹강좌나 동영상 강의가 잘 되어 있으니 참고한다.
https://www.youtube.com/watch?v=cp2aFNtcZfk
7. install shield 는 훨씬 더 강력하다. sql express 의 자동설치 sql script 돌리기 등이 가능하다.
끝 !
windows fw c#
clr script
http://stackoverflow.com/questions/4136028/get-the-code-of-a-clr-stored-procedure
SQLStress version 0.1
SQL Server 의 성능을 테스트 할 수 있음
visual studio 2013 .net framework 4.5 기반으로 작성되어 있음
visual studio 2013은 현재 무료 입니다. (작은회사나, 개인용)
ostress 보다 편리하고, adam 의 test 테스트프로그램 보다 가벼움
hp 의 load runner 와 거의 동일한 테스트가 가능하며 vuser 살 필요없이 이걸로 모든 테스트가 가능하다.
수정하면, 파일만들기, cpu, memory, disk, network 별 다양한 워크로드를 줄 수 있다.
1. SQLStressDatabase 를 다운받아 Config database 를 생성한다.
2. SQLStressCSharp 을 다운받아 CConfig 의 connection string 을 고친다.
3. tConfig 테이블에 Target SQL Server 의 Connection string 을 고친다.
4. SQLStressDatabase 의 perf 데이터베이스를 만들고 cpu, memory procedure 를 만든다.
이후 테스트를 하면 된다.
CPU Test 결과
Memory Test 결과
samsung kies 설치에러
windows 8.1 kn 버전에서 samsung kies 설치시
windows media feature pack 깔아돌라고 디펜던시 체크함 -_- 아 짜승
windows media feature pack 은 깔려고하면 에러!
오류 2149842967 "" 때문에 Windows 업데이트 을(를) 설치할 수 없습니다(명령줄: ""C:\Windows\system32\wusa.exe" "C:\Users\민석\Downloads\Windows6.2-KB2703761-x64.msu" ").
kies 설치파일에서 속성을 눌러서 win7 이라고 설정하면 잘 설치된다.
설치하고 실행하면 ㅜ.ㅜ 음하하하하~
오류 있는 응용 프로그램 이름: Kies3.exe, 버전: 3.2.14113.3, 타임스탬프: 0x5469b756
오류 있는 모듈 이름: WMVCore.DLL, 버전: 6.3.9600.17476, 타임스탬프: 0x54516af9
예외 코드: 0xc0000135
오류 오프셋: 0x000a36e5
오류 있는 프로세스 ID: 0x1774
오류 있는 응용 프로그램 시작 시간: 0x01d028fea0d595df
오류 있는 응용 프로그램 경로: C:\Program Files (x86)\Samsung\Kies3\Kies3.exe
오류 있는 모듈 경로: WMVCore.DLL
보고서 ID: 42d017f7-94f2-11e4-9c7e-0025226e633d
오류 있는 패키지 전체 이름:
오류 있는 패키지에 상대적인 응용 프로그램 ID:
KB2835517 를 설치 후 된다....
삽질의 끝을 하게 하는구만......이거 쒸 쓰라고 만든거 맞어?
막 sql 2018을 성공적으로 설치한 기분 -_-V